Packages

object Lifecycle extends LifecycleInstances

Linear Supertypes
LifecycleInstances, LifecycleCatsInstances, LifecycleCatsInstancesLowPriority, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Lifecycle
  2. LifecycleInstances
  3. LifecycleCatsInstances
  4. LifecycleCatsInstancesLowPriority
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. 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() }
    }
  2. 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]
    }
  3. trait FromCats[F[_], A] extends Lifecycle[F, A]
  4. trait FromPair[F[_], A] extends Lifecycle[F, A]
  5. trait FromZIO[R, E, A] extends Lifecycle[[γ$12$]ZIO[R, E, γ$12$], A]
  6. class LiftF[+F[_], A] extends NoCloseBase[F, A]

    Class-based variant of liftF:

    Class-based variant of liftF:

    class IntRes extends Lifecycle.LiftF(acquire = IO(1000))

    For binding resources using class syntax in ModuleDef:

    val module = new ModuleDef {
      make[Int].fromResource[IntRes]
    }
    Note

    acquire is performed interruptibly, unlike in Make

  7. 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]
    }
  8. 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]
    }
  9. 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]
    }
  10. trait Mutable[+A] extends Self[Identity, A]
  11. trait MutableNoClose[+A] extends SelfNoClose[Identity, A]
  12. trait MutableOf[+A] extends SelfOf[Identity, A]
  13. abstract class NoClose[+F[_], A] extends NoCloseBase[F, A] with Basic[F, A]
  14. abstract class NoCloseBase[+F[_], +A] extends Lifecycle[F, A]
  15. 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

  16. 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]
    }
  17. 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

  18. 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]
    }
  19. 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]
    }
  20. 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]
    }
  21. trait Self[+F[_], +A] extends Lifecycle[F, A]
  22. abstract class SelfNoClose[+F[_], +A] extends NoCloseBase[F, A]
  23. trait SelfOf[+F[_], +A] extends Lifecycle[F, A]
  24. trait Simple[A] extends Basic[Identity, A]
  25. implicit final class SyntaxLifecycleCats[+F[_], +A] extends AnyVal
  26. final class SyntaxLifecycleFromZIO[R] extends AnyVal
  27. implicit final class SyntaxLifecycleIdentity[+A] extends AnyVal
  28. implicit final class SyntaxLifecycleMapK[+F[_], +A] extends AnyVal
  29. implicit final class SyntaxLifecycleZIO[-R, +E, +A] extends AnyVal
  30. implicit final class SyntaxLifecycleZManaged[-R, +E, +A] extends AnyVal
  31. implicit final class SyntaxPure[F[_]] extends AnyVal
  32. implicit final class SyntaxUnsafeGet[F[_], A] extends AnyVal
  33. implicit final class SyntaxUse[F[_], +A] extends AnyVal
  34. implicit final class SyntaxUseEffect[F[_], A] extends AnyVal
  35. implicit final class SyntaxWidenError[F[+_, +_], +E, +A] extends AnyVal

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. implicit final def catsFunctorForLifecycle[F[_], Functor[_[_]]](implicit arg0: cats.Functor[Functor], F: QuasiFunctor[F]): Functor[[β$26$]Lifecycle[F, β$26$]]
    Definition Classes
    LifecycleCatsInstancesLowPriority
  6. implicit final def catsMonadForLifecycle[Monad[_[_]], F[_]](implicit arg0: cats.Monad[Monad], P: QuasiPrimitives[F]): Monad[[β$23$]Lifecycle[F, β$23$]]
    Definition Classes
    LifecycleCatsInstances
  7. 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
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def fail[F[_], A](error: => Throwable)(implicit F: QuasiIO[F]): Lifecycle[F, A]
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  13. 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

  14. 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

  15. def fork_[F[+_, +_], E, A](f: F[E, A])(implicit arg0: Fork2[F], arg1: Functor2[F]): Lifecycle[[β$1$]F[Nothing, β$1$], Unit]

    See also

    fork

  16. def fromAutoCloseable[A <: AutoCloseable](acquire: => A): Lifecycle[Identity, A]
  17. def fromAutoCloseable[F[_], A <: AutoCloseable](acquire: => F[A])(implicit F: QuasiIO[F]): Lifecycle[F, A]
  18. def fromCats[F[_], A](resource: Resource[F, A])(implicit F: Sync[F]): FromCats[F, A]

    Convert cats.effect.Resource to Lifecycle

  19. def fromExecutorService[A <: ExecutorService](acquire: => A): Lifecycle[Identity, A]
  20. def fromExecutorService[F[_], A <: ExecutorService](acquire: => F[A])(implicit F: QuasiIO[F]): Lifecycle[F, A]
  21. 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]
  22. def fromZLayer[R, E, A](layer: ZLayer[R, E, A])(implicit arg0: Tag[A]): FromZIO[R, E, A]

    Convert zio.ZLayer to Lifecycle

  23. def fromZLayerZEnv[R, E, A](layer: ZLayer[R, E, A]): FromZIO[R, E, ZEnvironment[A]]

    Convert zio.ZLayer to Lifecycle

  24. def fromZManaged[R, E, A](managed: ZManaged[R, E, A]): FromZIO[R, E, A]

    Convert zio.managed.ZManaged to Lifecycle

  25. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. def liftF[F[_], A](effect: => F[A])(implicit F: QuasiApplicative[F]): Lifecycle[F, A]

    effect

    is performed interruptibly, unlike in make

  29. def make[F[_], A](acquire: => F[A])(release: (A) => F[Unit]): Lifecycle[F, A]
  30. def makePair[F[_], A](allocate: F[(A, F[Unit])]): Lifecycle[F, A]
  31. def makeSimple[A](acquire: => A)(release: (A) => Unit): Lifecycle[Identity, A]
  32. 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.

  33. def make_[F[_], A](acquire: => F[A])(release: => F[Unit]): Lifecycle[F, A]
  34. 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
  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  38. def pure[F[_]]: SyntaxPure[F]
    Annotations
    @inline()
  39. def suspend[F[_], A](effect: => F[Lifecycle[F, A]])(implicit arg0: QuasiPrimitives[F]): Lifecycle[F, A]

    effect

    is performed interruptibly, unlike in make

  40. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  41. def toString(): String
    Definition Classes
    AnyRef → Any
  42. def traverse[F[_], A, B](l: Iterable[A])(f: (A) => Lifecycle[F, B])(implicit arg0: QuasiPrimitives[F]): Lifecycle[F, List[B]]
  43. def traverse_[F[_], A](l: Iterable[A])(f: (A) => Lifecycle[F, Unit])(implicit arg0: QuasiPrimitives[F]): Lifecycle[F, Unit]
  44. def unit[F[_]](implicit F: QuasiApplicative[F]): Lifecycle[F, Unit]
  45. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  46. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  47. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  48. object FromZIO

Inherited from LifecycleInstances

Inherited from LifecycleCatsInstances

Inherited from LifecycleCatsInstancesLowPriority

Inherited from AnyRef

Inherited from Any

Ungrouped