cats-effect icon indicating copy to clipboard operation
cats-effect copied to clipboard

POC: plugging the `cancelable` leak

Open armanbilge opened this issue 2 years ago • 0 comments
trafficstars

Implements a proof-of-concept for my proposal in https://github.com/typelevel/cats-effect/issues/3474#issuecomment-1459309054.

To re-iterate:

  1. IO.Cancelable[+A](ioa: IO[A], cancel: IO[Unit]) is now a primitive operation
  2. When you enter a Cancelable, it exposes its cancel operation as part of the fiber.cancel.
  3. By leaning into uncancelable semantics, this guarantees that the final result of ioa (be it success, error, or cancellation) will always be propagated.

As such, it plugs the leak.

armanbilge avatar Mar 11 '23 01:03 armanbilge