cats-effect
cats-effect copied to clipboard
`Dispatcher` that backpressures on completion (not cancellation)
Spinning out of https://github.com/typelevel/cats-effect/issues/2519#issuecomment-963620976, which will be closed shortly.
Idk if it's possible/makes sense, but an alternative API where closing backpressures until completion (rather than cancellation) could be interesting? It could reject new submissions, but wait until old ones are all done.
Not sure if this applicable to Supervisor itself.
One possible flaw with this idea is that if you start a never-completing fiber (e.g. a server) with dispatcher and don't have any way to cancel it, then unless your dispatcher cancels it on close are you are stuck :)
This is actually done in 3.4.0