How to "block" in an agnostic way?

My current understanding of cancellation, thanks to other thread ( Understanding cancellation (in eio) ) is that it only comes into play if we want to use Suspend to expose low-level asynchronous operations, but not in the case where we use Suspend to wait on a computation happening somewhere else. I think that the latter is a very common use-case for “agnostic blocking”, and it can use your simpler Suspend effect. (Even a cancellation-aware scheduler can use the simple Suspend in this case.)

If we want to later provide a scheduler-agnostic way to implement low-level asynchronous operations with cancellation, we would possibly want a second effect with a different interface, but the users of the first effect would need no change.

1 Like