question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQ] Cancellation support for client.ReceiveAsync()

See original GitHub issue

Is your feature request related to a problem? Please describe.

Azure Service Bus is using long-polling to retrieve messages. That means user code has to wait for command execution before an endpoint can shut down. With asynchronous libraries, it’s a common theme and a recommended practice to pass a CancellationToken to invoke earlier termination of work.

Describe the solution you’d like

  1. Add support for CancellationToken to ReceiveAsync()
  2. Consider a review of the client to support cancellation pattern throughout various APIs (ReceiveAsync(), SendAsync(), AcceptMessageSessionAsync(), etc).

Describe alternatives you’ve considered

For the context, here’s the original issue from the client’s previous repository: https://github.com/Azure/azure-service-bus-dotnet/issues/439#issuecomment-423770087

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
SeanFeldmancommented, Aug 3, 2019

@axisc closing public issues in favour of an internal backlog is not a good idea. Please keep public issues open and close when the internal issues are completed.

image

2reactions
jfggdlcommented, Nov 26, 2019

Thanks for your feedback. We will keep this issue open and will update it once we have any news about the candidate feature to implement token cancellation support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - How to to make UdpClient.ReceiveAsync() cancelable?
Unfortunately, SendAsync() of the UdpClient class does not accept a CancellationToken . So I started changing it to: public Task<bool> SendAsync ...
Read more >
UdpClient.ReceiveAsync Method (System.Net.Sockets)
ReceiveAsync (CancellationToken)​​ Returns a UDP datagram asynchronously that was sent by a remote host.
Read more >
Code, code and more code.: May 2020 - Marc Gravell
Run(async () => { try { await foreach (var message in request.WithCancellation(allDone.Token)) { await transport.SendAsync(message, allDone.
Read more >
Asynchronous programming - AWS SDK for Java 2.x
Synchronous methods block your thread's execution until the client receives a response from the service. Asynchronous methods return immediately, giving control ...
Read more >
Async/Await - NetMQ - Read the Docs
NetMQRuntime.Run can accept multiple tasks and also a cancellation token. NetMQRuntime.Run runs until all tasks are completed or cancellation token has been ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found