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. 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]
    }
  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[[γ$8$]ZIO[R, E, γ$8$], 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]
    }
    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]
    }
  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]
    }
  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]
    }
  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]
    }
    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]
    }
  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[[γ$7$]ZIO[R, E, γ$7$], 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]
    }
  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. implicit final class SyntaxLifecycleIdentity[+A] extends AnyVal
  27. implicit final class SyntaxLifecycleMapK[+F[_], +A] extends AnyVal
  28. implicit final class SyntaxLifecycleZIO[-R, +E, +A] extends AnyVal
  29. implicit final class SyntaxLocatorRun[F[_]] extends AnyVal
  30. implicit final class SyntaxPure[F[_]] extends AnyVal
  31. implicit final class SyntaxUnsafeGet[F[_], A] extends AnyVal
  32. implicit final class SyntaxUse[F[_], +A] extends AnyVal
  33. implicit final class SyntaxUseEffect[F[_], A] extends AnyVal
  34. implicit final class SyntaxWidenError[F[+_, +_], +E, +A] extends AnyVal
  35. type TrifunctorHasLifecycleTag[R0, T] = TrifunctorHasLifecycleTagImpl[R0, T]

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: QuasiPrimitives[F]): Monad[[β$23$]Lifecycle[F, β$23$]]
    Definition Classes
    LifecycleCatsInstances
  10. 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
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  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 finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. 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

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

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

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

    Convert cats.effect.Resource to Lifecycle

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

    Convert zio.ZManaged to Lifecycle

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

    effect

    is performed interruptibly, unlike in make

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

  39. 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:

  40. 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:

  41. 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:

  42. 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:

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

    effect

    is performed interruptibly, unlike in make

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

Inherited from LifecycleInstances

Inherited from LifecycleCatsInstances

Inherited from LifecycleCatsInstancesLowPriority

Inherited from AnyRef

Inherited from Any

Ungrouped