Why doesn't the SendAsync extension take a CancellationToken?

Answered Why doesn't the SendAsync extension take a CancellationToken?

  • 4. července 2011 13:44
     
     

    Unlike ReceiveAsync, the current SendAsync extension doesn't provide cancellation and I was wondering if this was by design, or due to the current implementation that uses a SendAsyncSource internally for the send.

    Since the item may be buffered for a while until accepted by the target and because the operation returns a task, it seems like SendAsync is a good candidate for cancellation.

    Thanks,

    Shawn

Všechny reakce

  • 5. července 2011 16:44
    Vlastník
     
     Odpovědět

    Hi Shawn-

    Thanks for the feedback!  There's nothing technically preventing accepting a CancellationToken here, we just didn't expect this is something folks might want to cancel.  Now that we know it is, we'll certainly consider it.

    Thanks!

    Stephen

  • 7. července 2011 13:22
     
     

    Thanks Stephen. Cancelling the outstanding send would definitely be helpful for us.