object Lifecycle extends LifecycleCatsInstances

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

Type Members

  1. type AdaptFunctoid[A] = AdaptFunctoidImpl[A]

    Support binding various FP libraries' Resource types in .fromResource

  2. 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() }
    }
  3. 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]
    }
    Annotations
    @open()
  4. trait FromCats[F[_], A] extends Lifecycle[F, A]
  5. trait FromPair[F[_], A] extends Lifecycle[F, A]
  6. trait FromZIO[R, E, A] extends Lifecycle[[γ$22$]ZIO[R, E, γ$22$], A]
  7. type LifecycleTag[R] = LifecycleTagImpl[R]
  8. 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]
    }
    Annotations
    @open()
    Note

    acquire is performed interruptibly, unlike in Make

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

  18. 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]
    }
    Annotations
    @open()
  19. 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

  20. class OfZIO[-R, +E, +A] extends Of[[γ$21$]ZIO[R, E, γ$21$], A]

    Class-based proxy over a zio.ZManaged value

    Class-based proxy over a zio.ZManaged value

    class IntRes extends Lifecycle.OfZIO(Managed.succeed(1000))

    For binding resource values using class syntax in ModuleDef:

    val module = new ModuleDef {
      make[Int].fromResource[IntRes]
    }
    Annotations
    @open()
  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 SyntaxFlatten[F[_], +A] extends AnyVal
  26. implicit final class SyntaxLifecycleCats[+F[_], +A] 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 SyntaxLocatorRun[F[_]] 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
  36. type TrifunctorHasLifecycleTag[R0, T] = TrifunctorHasLifecycleTagImpl[R0, T]

Deprecated Type Members

  1. type AdaptProvider[A] = AdaptFunctoidImpl[A]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) renamed to AdaptFunctoid

  2. type DIResourceBase[+F[_], +A] = Lifecycle[F, A]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) Use distage.Lifecycle

  3. type ResourceTag[R] = LifecycleTagImpl[R]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) renamed to LifecycleTag

  4. type TrifunctorHasResourceTag[R0, T] = TrifunctorHasLifecycleTagImpl[R0, T]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) renamed to TrifunctorHasLifecycleTag

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. lazy val AdaptFunctoid: AdaptFunctoidImpl.type
  5. lazy val LifecycleTag: LifecycleTagImpl.type
  6. lazy val TrifunctorHasLifecycleTag: TrifunctorHasLifecycleTagImpl.type
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. implicit final def catsFunctorForLifecycle[F[_], Functor[_[_]]](implicit arg0: cats.Functor[Functor], F: QuasiFunctor[F]): Functor[[β$26$]Lifecycle[F, β$26$]]
    Definition Classes
    LifecycleCatsInstancesLowPriority
  9. implicit final def catsMonadForLifecycle[Monad[_[_]], F[_]](implicit arg0: cats.Monad[Monad], F: QuasiIO[F]): Monad[[β$23$]Lifecycle[F, β$23$]]
    Definition Classes
    LifecycleCatsInstances
  10. implicit final def catsMonoidForLifecycle[Monoid[_], F[_], A](implicit arg0: cats.kernel.Monoid[Monoid], F: QuasiIO[F], A0: Monoid[A]): Monoid[Lifecycle[F, A]]
    Definition Classes
    LifecycleCatsInstances
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def fail[F[_], A](error: => Throwable)(implicit F: QuasiIO[F]): Lifecycle[F, A]
  15. 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

  16. def forkCats[F[_], A](f: F[A])(implicit F: Concurrent[F]): Lifecycle[F, Fiber[F, 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

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

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

    Convert cats.effect.Resource to Lifecycle

  21. def fromExecutorService[A <: ExecutorService](acquire: => A): Lifecycle[Identity, A]
  22. def fromExecutorService[F[_], A <: ExecutorService](acquire: => F[A])(implicit F: QuasiIO[F]): Lifecycle[F, A]
  23. def fromZIO[R, E, A](managed: ZManaged[R, E, A]): FromZIO[R, E, A]

    Convert zio.ZManaged to Lifecycle

  24. implicit final def functor2ForLifecycle[F[+_, +_]](implicit arg0: Functor2[F]): Functor2[[+β$7$, +γ$8$]Lifecycle[[β$0$]F[β$7$, β$0$], γ$8$]]
  25. implicit final def functor3ForLifecycle[F[-_, +_, +_]](implicit arg0: Functor3[F]): Functor3[[-β$13$, +γ$14$, +δ$15$]Lifecycle[[γ$1$]F[β$13$, γ$14$, γ$1$], δ$15$]]
  26. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  27. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. def liftF[F[_], A](effect: => F[A])(implicit F: QuasiApplicative[F]): Lifecycle[F, A]

    effect

    is performed interruptibly, unlike in make

  30. def make[F[_], A](acquire: => F[A])(release: (A) => F[Unit]): Lifecycle[F, A]
  31. def makePair[F[_], A](allocate: F[(A, F[Unit])]): Lifecycle[F, A]
  32. def makeSimple[A](acquire: => A)(release: (A) => Unit): Lifecycle[Identity, A]
  33. def make_[F[_], A](acquire: => F[A])(release: => F[Unit]): Lifecycle[F, A]
  34. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  35. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  37. implicit final def providerFromCats[F[_], A](resource: => Resource[F, A])(implicit arg0: TagK[F], tag: Tag[FromCats[F, A]]): Functoid[FromCats[F, A]]

    Allows you to bind cats.effect.Resource-based constructors in ModuleDef:

    Allows you to bind cats.effect.Resource-based constructors in ModuleDef:

    Example:

    import cats.effect._
    
    val catsResource = Resource.liftF(IO(5))
    
    val module = new distage.ModuleDef {
      make[Int].fromResource(catsResource)
    }
    Note

    binding a cats Resource[F, A] will add a dependency on Sync[F] for your corresponding F type (Sync[F] instance will generally be provided automatically via izumi.distage.modules.DefaultModule)

  38. implicit final def providerFromZIO[R, E, A](managed: => ZManaged[R, E, A])(implicit tag: Tag[FromZIO[R, E, A]]): Functoid[FromZIO[R, E, A]]

    Allows you to bind zio.ZManaged-based constructors in ModuleDef:

  39. implicit final def providerFromZIONothing[R, A](managed: => ZManaged[R, Nothing, A])(implicit tag: Tag[FromZIO[R, Nothing, A]]): Functoid[FromZIO[R, Nothing, A]]

    Allows you to bind zio.ZManaged-based constructors in ModuleDef:

  40. implicit final def providerFromZLayerHas1[R, E, A](layer: => ZLayer[R, E, Has[A]])(implicit arg0: Tag[A], tag: Tag[FromZIO[R, E, A]]): Functoid[FromZIO[R, E, A]]

    Allows you to bind zio.ZLayer-based constructors in ModuleDef:

  41. implicit final def providerFromZLayerNothingHas1[R, A](layer: => ZLayer[R, Nothing, Has[A]])(implicit arg0: Tag[A], tag: Tag[FromZIO[R, Nothing, A]]): Functoid[FromZIO[R, Nothing, A]]

    Allows you to bind zio.ZLayer-based constructors in ModuleDef:

  42. def pure[F[_]]: SyntaxPure[F]
    Annotations
    @inline()
  43. def suspend[F[_], A](effect: => F[Lifecycle[F, A]])(implicit arg0: QuasiIO[F]): Lifecycle[F, A]

    effect

    is performed interruptibly, unlike in make

  44. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  45. def toString(): String
    Definition Classes
    AnyRef → Any
  46. def unit[F[_]](implicit F: QuasiApplicative[F]): Lifecycle[F, Unit]
  47. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  48. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  49. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  50. object DIResourceBase

Deprecated Value Members

  1. lazy val AdaptProvider: AdaptFunctoidImpl.type
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) renamed to AdaptFunctoid

  2. lazy val ResourceTag: LifecycleTagImpl.type
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) renamed to LifecycleTag

  3. lazy val TrifunctorHasResourceTag: TrifunctorHasLifecycleTagImpl.type
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) renamed to TrifunctorHasLifecycleTag

  4. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated
  5. def fromAutoCloseableF[F[_], A <: AutoCloseable](acquire: => F[A])(implicit F: QuasiIO[F]): Lifecycle[F, A]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) renamed to fromAutoCloseable

Inherited from LifecycleCatsInstances

Inherited from LifecycleCatsInstancesLowPriority

Inherited from AnyRef

Inherited from Any

Ungrouped