You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the terminateAll() function will resume all the suspended operations (producers and consumers). What if the sending operations are performed in several Tasks? it means the async channel is finished for every one of them, which seem a bit violent right ?
The text was updated successfully, but these errors were encountered:
twittemb
changed the title
[AsyncChannel] Question: is task cancellation in sending to violent?
[AsyncChannel] Question: is task cancellation in sending operations too violent?
Jul 22, 2022
I guess in case of a sending cancellation, we should only make sure the sending continuation is resumed immediately, and the operation is removed from the pending list (and only that operation). If we are in the case where there is an awaiting that is being resumed by the sending then we should also check for Task.isCancelled right before resuming the awaiting and not do it if there is a cancellation ?
Hi @phausler
I was wondering if the task cancellation when sending an element in an AsyncChannel was not a bit too violent ?
This is the code when sending an element:
the
terminateAll()
function will resume all the suspended operations (producers and consumers). What if the sending operations are performed in several Tasks? it means the async channel is finished for every one of them, which seem a bit violent right ?The text was updated successfully, but these errors were encountered: