Make produce
itself interruptible to work with ZIO interruption inheritance
#1371
Labels
produce
itself interruptible to work with ZIO interruption inheritance
#1371
After #1138
Lifecycle
encoding itself supports interruptibility, but since the entirety ofInjector#produce
happens in an uninterruptible region, this causes problems with ZIO's odd interruption inheritance (gitter thread)It seems like this can't be solved by just wrapping all ZIO's in
.interruptible
, because ZIO effects can come not just from ZManaged, but from Lifecycle and Resource too.Instead, produce can be made interruptible, with individual resource acquiries being uninterruptible, as long as we setup a finalizer for contents of
ProvisionMutable
and as long as the region between Lifecycle being acquired and its finalizer being inserted intoProvisionMutable
is uninterruptible, it would be safe to for the rest ofproduce
to be interruptible.The text was updated successfully, but these errors were encountered: