ZManagedZIOCompanionSyntax

final implicit class ZManagedZIOCompanionSyntax(self: ZIO.type) extends AnyVal
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def reserve[R, E, A, B](reservation: => ZIO[R, E, Reservation[R, E, A]])(use: A => ZIO[R, E, B])(implicit trace: Trace): ZIO[R, E, B]

Acquires a resource, uses the resource, and then releases the resource. However, unlike acquireReleaseWith, the separation of these phases allows the acquisition to be interruptible.

Acquires a resource, uses the resource, and then releases the resource. However, unlike acquireReleaseWith, the separation of these phases allows the acquisition to be interruptible.

Useful for concurrent data structures and other cases where the 'deallocator' can tell if the allocation succeeded or not just by inspecting internal / external state.