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
Fix#503 implement MonadCancel#canceled by sending an external interrupt to current fiber via Fiber.unsafeCurrentFiber (#544)
* Workaround zio/zio#6911 Only consider the *current* fiber being interrupted as `Outcome.Canceled`, consider internal interruption & Die to be `Outcome.Errored`
Trigger `MonadCancel#onCancel` only if the *current* fiber is being interrupted
Implement `MonadCancel#bracketFull` & `bracketCase`
* Fix#503 Find a way to send interrupt to self via `Fiber.unsafeCurrentFiber`, implement external-only Cancel semantic for `start` and `raceWith`
* make `MonadError#onError` consistent with `guaranteeCase` starting from `MonadCancel` instance
* Add tests for zio/zio#6911 (require #543)
* Fix js implementation of `async`
* arbitrary instance: convert from cats-effect
* rebase
* Use throwable instead of generic instance in `ZManaged#toResource[F]`
* Remove exceptions for inner interruption in generic error instances & generate Interrupted Causes for generic tests
* In tests, add more generators + cats conversion generators - disabled by default, because they surface further law failures still
* Fix `calls finalizers when using resource is canceled` test, fix unreliability of `canceled` when used with `unsafeRunToFuture`
* Change `toEffect` implementation to avoid getting a `BoxedException` when the underlying fiber is interrupted.
* Relax condition for signalling non-interruption, because ZIO sometimes creates invalid Causes without Interrupt node when interrupted
* Add `genNever` to random generators
* Change the implementation of `Async#async` to follow `async left is uncancelable sequenced raiseError` law.
Consider the law code:
```scala
// format: off
def asyncLeftIsUncancelableSequencedRaiseError[A](e: Throwable, fu: F[Unit]) =
(F.async[A](k => F.delay(k(Left(e))) >> fu.as(None)) <* F.unit) <-> (F.uncancelable(_ => fu) >> F.raiseError(e))
// format: on
```
if `fu` is `F.never`, then an implmentation based on ZIO.effectAsyncM can never satisfy this law,
because it runs the register code on a separate fiber and ignores its effect.
The law clearly states that register effect must run first and must run on the same fiber
as the callback listener, so as to supercede it.
* 2.12 build
* Remove incorrect `onError` definition. (should not be uncancelable)
* Remove redundant `resetForkScope`
* Acknowledge `onError`/`Outcome.Errored` incoherence in tests
* Restore no-op F.onError in `parTraverse + ZIO.die` test
// Generating interrupt failures causes law failures (`canceled`/`Outcome.Canceled` are ill-defined as of now https://github.com/zio/interop-cats/issues/503#issuecomment-1157101175=)
0 commit comments