object Lifecycle extends LifecycleInstances
- Alphabetic
- By Inheritance
- Lifecycle
- LifecycleInstances
- LifecycleCatsInstances
- LifecycleCatsInstancesLowPriority
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait Basic[+F[_], A] extends Lifecycle[F, A]
A sub-trait of izumi.distage.model.definition.Lifecycle suitable for less-complex resource definitions via inheritance that do not require overriding izumi.distage.model.definition.Lifecycle#InnerResource.
A sub-trait of izumi.distage.model.definition.Lifecycle suitable for less-complex resource definitions via inheritance that do not require overriding izumi.distage.model.definition.Lifecycle#InnerResource.
final class BufferedReaderResource( file: File ) extends Lifecycle.Basic[IO, BufferedReader] { def acquire: IO[BufferedReader] = IO { new BufferedReader(new FileReader(file)) } def release(reader: BufferedReader): IO[BufferedReader] = IO { reader.close() } }
- class FromAutoCloseable[+F[_], +A <: AutoCloseable] extends Of[[_]F[_], A]
Class-based variant of fromAutoCloseable:
Class-based variant of fromAutoCloseable:
class FileOutputRes extends Lifecycle.FromAutoCloseable( acquire = IO(new FileOutputStream("abc")) )
For binding resources using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- trait FromCats[F[_], A] extends Lifecycle[F, A]
- trait FromPair[F[_], A] extends Lifecycle[F, A]
- trait FromZIO[R, E, A] extends Lifecycle[[γ$12$]ZIO[R, E, γ$12$], A]
- class LiftF[+F[_], A] extends NoCloseBase[F, A]
Class-based variant of liftF:
- class Make[+F[_], A] extends Basic[F, A]
Class-based variant of make:
Class-based variant of make:
class IntRes extends Lifecycle.Make( acquire = IO(1000) )(release = _ => IO.unit)
For binding resources using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- class MakePair[F[_], A] extends FromPair[F, A]
Class-based variant of makePair:
Class-based variant of makePair:
class IntRes extends Lifecycle.MakePair(IO(1000 -> IO.unit))
For binding resources using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- class Make_[+F[_], A] extends Make[F, A]
Class-based variant of make_:
Class-based variant of make_:
class IntRes extends Lifecycle.Make_(IO(1000))(IO.unit)
For binding resources using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- trait Mutable[+A] extends Self[Identity, A]
- trait MutableNoClose[+A] extends SelfNoClose[Identity, A]
- trait MutableOf[+A] extends SelfOf[Identity, A]
- abstract class NoClose[+F[_], A] extends NoCloseBase[F, A] with Basic[F, A]
- abstract class NoCloseBase[+F[_], +A] extends Lifecycle[F, A]
- class Of[+F[_], +A] extends OfInner[F, A]
Class-based proxy over a Lifecycle value
Class-based proxy over a Lifecycle value
class IntRes extends Lifecycle.Of(Lifecycle.pure(1000))
For binding resource values using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- Note
when the expression passed to Lifecycle.Of defines many local methods it can hit a Scalac bug https://github.com/scala/bug/issues/11969 and fail to compile, in that case you may switch to Lifecycle.OfInner
- class OfCats[F[_], A] extends Of[F, A]
Class-based proxy over a cats.effect.Resource value
Class-based proxy over a cats.effect.Resource value
class IntRes extends Lifecycle.OfCats(Resource.pure(1000))
For binding resource values using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- trait OfInner[+F[_], +A] extends Lifecycle[F, A]
Trait-based proxy over a Lifecycle value
Trait-based proxy over a Lifecycle value
class IntRes extends Lifecycle.OfInner[IO, Int] { override val lifecycle: Lifecycle[IO, Int] = Lifecycle.pure(1000) }
For binding resource values using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- Note
This class may be used instead of Lifecycle.Of to workaround scalac bug https://github.com/scala/bug/issues/11969 when defining local methods
- class OfZIO[-R, +E, +A] extends Of[[γ$9$]ZIO[R, E, γ$9$], A]
Class-based proxy over a scoped zio.ZIO value
Class-based proxy over a scoped zio.ZIO value
class IntRes extends Lifecycle.OfZIO(ZIO.acquireRelease(ZIO.succeed(1000))(_ => ZIO.unit))
For binding resource values using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- class OfZLayer[-R, +E, +A] extends Of[[γ$11$]ZIO[R, E, γ$11$], A]
Class-based proxy over a zio.ZLayer value
Class-based proxy over a zio.ZLayer value
class IntRes extends Lifecycle.OfZLayer(ZLayer.succeed(1000))
For binding resource values using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- class OfZManaged[-R, +E, +A] extends Of[[γ$10$]ZIO[R, E, γ$10$], A]
Class-based proxy over a zio.managed.ZManaged value
Class-based proxy over a zio.managed.ZManaged value
class IntRes extends Lifecycle.OfZManaged(ZManaged.succeed(1000))
For binding resource values using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- trait Self[+F[_], +A] extends Lifecycle[F, A]
- abstract class SelfNoClose[+F[_], +A] extends NoCloseBase[F, A]
- trait SelfOf[+F[_], +A] extends Lifecycle[F, A]
- trait Simple[A] extends Basic[Identity, A]
- implicit final class SyntaxLifecycleCats[+F[_], +A] extends AnyVal
- final class SyntaxLifecycleFromZIO[R] extends AnyVal
- implicit final class SyntaxLifecycleIdentity[+A] extends AnyVal
- implicit final class SyntaxLifecycleMapK[+F[_], +A] extends AnyVal
- implicit final class SyntaxLifecycleZIO[-R, +E, +A] extends AnyVal
- implicit final class SyntaxLifecycleZManaged[-R, +E, +A] extends AnyVal
- implicit final class SyntaxPure[F[_]] extends AnyVal
- implicit final class SyntaxUnsafeGet[F[_], A] extends AnyVal
- implicit final class SyntaxUse[F[_], +A] extends AnyVal
- implicit final class SyntaxUseEffect[F[_], A] extends AnyVal
- implicit final class SyntaxWidenError[F[+_, +_], +E, +A] extends AnyVal
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- implicit final def catsFunctorForLifecycle[F[_], Functor[_[_]]](implicit arg0: cats.Functor[Functor], F: QuasiFunctor[F]): Functor[[β$26$]Lifecycle[F, β$26$]]
- Definition Classes
- LifecycleCatsInstancesLowPriority
- implicit final def catsMonadForLifecycle[Monad[_[_]], F[_]](implicit arg0: cats.Monad[Monad], P: QuasiPrimitives[F]): Monad[[β$23$]Lifecycle[F, β$23$]]
- Definition Classes
- LifecycleCatsInstances
- implicit final def catsMonoidForLifecycle[Monoid[_], F[_], A](implicit arg0: cats.kernel.Monoid[Monoid], F: QuasiPrimitives[F], A0: Monoid[A]): Monoid[Lifecycle[F, A]]
- Definition Classes
- LifecycleCatsInstances
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fail[F[_], A](error: => Throwable)(implicit F: QuasiIO[F]): Lifecycle[F, A]
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fork[F[+_, +_], E, A](f: F[E, A])(implicit arg0: Fork2[F]): Lifecycle[[β$0$]F[Nothing, β$0$], Fiber2[F, E, A]]
Fork the specified action into a new fiber.
Fork the specified action into a new fiber. When this
Lifecycle
is released, the fiber will be interrupted using izumi.functional.bio.Fiber2#interrupt- returns
The fiber running
f
action
- def forkCats[F[_], E, A](f: F[A])(implicit F: GenConcurrent[F, E]): Lifecycle[F, Fiber[F, E, A]]
Fork the specified action into a new fiber.
Fork the specified action into a new fiber. When this
Lifecycle
is released, the fiber will be interrupted using cats.effect.Fiber#cancel- returns
The fiber running
f
action
- def fork_[F[+_, +_], E, A](f: F[E, A])(implicit arg0: Fork2[F], arg1: Functor2[F]): Lifecycle[[β$1$]F[Nothing, β$1$], Unit]
- See also
- def fromAutoCloseable[A <: AutoCloseable](acquire: => A): Lifecycle[Identity, A]
- def fromAutoCloseable[F[_], A <: AutoCloseable](acquire: => F[A])(implicit F: QuasiIO[F]): Lifecycle[F, A]
- def fromCats[F[_], A](resource: Resource[F, A])(implicit F: Sync[F]): FromCats[F, A]
Convert cats.effect.Resource to Lifecycle
- def fromExecutorService[A <: ExecutorService](acquire: => A): Lifecycle[Identity, A]
- def fromExecutorService[F[_], A <: ExecutorService](acquire: => F[A])(implicit F: QuasiIO[F]): Lifecycle[F, A]
- def fromZIO[R]: SyntaxLifecycleFromZIO[R]
Convert a Scoped zio.ZIO to Lifecycle
Convert a Scoped zio.ZIO to Lifecycle
def fromZIO[R, E, A](f: ZIO[Scope with R, E, A]): Lifecycle.FromZIO[R, E, A]
- def fromZLayer[R, E, A](layer: ZLayer[R, E, A])(implicit arg0: Tag[A]): FromZIO[R, E, A]
Convert zio.ZLayer to Lifecycle
- def fromZLayerZEnv[R, E, A](layer: ZLayer[R, E, A]): FromZIO[R, E, ZEnvironment[A]]
Convert zio.ZLayer to Lifecycle
- def fromZManaged[R, E, A](managed: ZManaged[R, E, A]): FromZIO[R, E, A]
Convert zio.managed.ZManaged to Lifecycle
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def liftF[F[_], A](effect: => F[A])(implicit F: QuasiApplicative[F]): Lifecycle[F, A]
- effect
is performed interruptibly, unlike in make
- def make[F[_], A](acquire: => F[A])(release: (A) => F[Unit]): Lifecycle[F, A]
- def makePair[F[_], A](allocate: F[(A, F[Unit])]): Lifecycle[F, A]
- def makeSimple[A](acquire: => A)(release: (A) => Unit): Lifecycle[Identity, A]
- def makeSimpleInit[A](create: => A)(init: (A) => Unit)(release: (A) => Unit): Lifecycle[Identity, A]
For stateful objects that have a separate post-creation init method.
- def make_[F[_], A](acquire: => F[A])(release: => F[Unit]): Lifecycle[F, A]
- implicit final def monad2ForLifecycle[F[+_, +_]](implicit arg0: Functor2[F], P: QuasiPrimitives[[+β$13$]F[Any, β$13$]]): Monad2[[+β$14$, +γ$15$]Lifecycle[[β$0$]F[β$14$, β$0$], γ$15$]]
- Definition Classes
- LifecycleInstances
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def pure[F[_]]: SyntaxPure[F]
- Annotations
- @inline()
- def suspend[F[_], A](effect: => F[Lifecycle[F, A]])(implicit arg0: QuasiPrimitives[F]): Lifecycle[F, A]
- effect
is performed interruptibly, unlike in make
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def traverse[F[_], A, B](l: Iterable[A])(f: (A) => Lifecycle[F, B])(implicit arg0: QuasiPrimitives[F]): Lifecycle[F, List[B]]
- def traverse_[F[_], A](l: Iterable[A])(f: (A) => Lifecycle[F, Unit])(implicit arg0: QuasiPrimitives[F]): Lifecycle[F, Unit]
- def unit[F[_]](implicit F: QuasiApplicative[F]): Lifecycle[F, Unit]
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object FromZIO