AcquireRelease

zio.ZLayer.Derive.AcquireRelease
trait AcquireRelease[-R, +E, A] extends Scoped[R, E]

A special form of Scoped for convenience.

When using ZLayer.derive with a type that implements AcquireRelease, the provided acquire and release methods will be automatically utilized as the lifecycle hooks.

Attributes

Note

This trait's lifecycle hooks are specifically designed to work with ZLayer.derive. Using it outside this context won't inherently attach any lifecycle behaviors to the type.

Graph
Supertypes
trait Scoped[R, E]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def acquire: ZIO[R, E, A]
def release(a: A): ZIO[R, Nothing, Any]

Concrete methods

final def scoped(implicit trace: Trace): ZIO[R & Scope, E, A]