How to use withTaskCancellationHandler properly?

Yeah that's right.

I'll keep bringing up another potential future solution to this issue every time we hit this issue :wink: It truly is important to allow synchronous contexts to send to an actor, without awaiting and thus allowing such callers to be synchronous contexts. This could take the form of send actor.cancelWorkPlease() which enqueues to the actor's mailbox, but cannot wait on it. Such "send" would really be perfect for such uni-directional communication, such as cancelling some work etc.

I (personally) sure would hope to get to prototyping and offering such capability someday.

19 Likes