Skip to content

Need some clarification on .net connection object in c#, slow consumers & Flow Control #704

Closed Answered by mtmk
DarkPhantom-Dev asked this question in Q&A
Discussion options

You must be logged in to vote

no worries, I hope it helps. Let me dig it out. I think there is one in another discussion.

edit: #523 (comment)

var batch = 100;
var futures = new NatsJSPublishConcurrentFuture[batch];

for (var i = 0; i < batch; i++)
{
    futures[i] = await _js.PublishConcurrentAsync("foo", i);
}

for (var i = 0; i < batch; i++)
{
    await using var future = futures[i];
    var ack = await future.GetResponseAsync();
    ack.EnsureSuccess();
}

Replies: 5 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@mtmk
Comment options

mtmk Jan 9, 2025
Maintainer

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@mtmk
Comment options

mtmk Jan 9, 2025
Maintainer

Answer selected by DarkPhantom-Dev
@DarkPhantom-Dev
Comment options

@mtmk
Comment options

mtmk Jan 27, 2025
Maintainer

Comment options

You must be logged in to vote
1 reply
@mtmk
Comment options

mtmk Jan 9, 2025
Maintainer

Comment options

You must be logged in to vote
1 reply
@mtmk
Comment options

mtmk Jan 31, 2025
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants