Packages

trait Injector extends Planner with Producer

Injector can create an object graph (Locator) from a ModuleBase or an izumi.distage.model.plan.OrderedPlan

See also

Planner

Producer

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Injector
  2. Producer
  3. Planner
  4. PlanSplittingOps
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def finish(semiPlan: SemiPlan): OrderedPlan
    Definition Classes
    Planner
  2. abstract def freeze(plan: PrePlan): SemiPlan
    Definition Classes
    Planner
  3. abstract def plan(input: PlannerInput): OrderedPlan
    Definition Classes
    Planner
  4. abstract def planNoRewrite(input: PlannerInput): OrderedPlan
    Definition Classes
    Planner
  5. abstract def prepare(input: PlannerInput): PrePlan
    Definition Classes
    Planner
  6. abstract def rewrite(bindings: ModuleBase): ModuleBase
    Definition Classes
    Planner
  7. abstract def truncate(plan: OrderedPlan, roots: Set[DIKey]): OrderedPlan
    Definition Classes
    Planner

Concrete 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. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def plan(bindings: ModuleBase, roots: Roots): OrderedPlan
    Definition Classes
    Planner
  16. final def produce(bindings: ModuleBase, roots: Roots): DIResourceBase[Identity, Locator]
  17. final def produce(input: PlannerInput): DIResourceBase[Identity, Locator]
  18. final def produce(plan: OrderedPlan): DIResourceBase[Identity, Locator]
    Definition Classes
    Producer
  19. final def produceDetailed(plan: OrderedPlan): DIResourceBase[Identity, Either[FailedProvision[Identity], Locator]]
    Definition Classes
    Producer
  20. final def produceDetailedF[F[_]](plan: OrderedPlan)(implicit arg0: TagK[F], arg1: DIEffect[F]): DIResourceBase[F, Either[FailedProvision[F], Locator]]
    Definition Classes
    Producer
  21. final def produceEval[A](bindings: ModuleBase)(function: ProviderMagnet[A])(implicit arg0: Tag[A]): DIResourceBase[Identity, A]
  22. final def produceEvalF[F[_], A](bindings: ModuleBase)(function: ProviderMagnet[F[A]])(implicit arg0: TagK[F], arg1: DIEffect[F]): DIResourceBase[F, A]

    Create an effectful izumi.distage.model.definition.DIResource value that encapsulates the allocation and cleanup of an object graph described by the input module, designate all arguments of the provided function as roots of the graph and run the function.

    Create an effectful izumi.distage.model.definition.DIResource value that encapsulates the allocation and cleanup of an object graph described by the input module, designate all arguments of the provided function as roots of the graph and run the function.

    class Hello { def hello() = println("hello") }
    class World { def world() = println("world") }
    
    Injector()
      .produceEval(new ModuleDef {
        make[Hello]
        make[World]
      }) {
        (hello: Hello, world: World) =>
          hello.hello()
          world
      }
      .use {
        world => world.hello()
      }

    This is useful for the common case when you want to run an effect using the produced objects from the object graph, without finalizing the object graph yet

    Injector().produceEvalF[F, A](moduleDef)(fn) is a short-hand for:

    Injector()
      .produceF[F](moduleDef, GCMode(fn.get.diKeys.toSet))
      .evalMap(_.run(fn))
  23. final def produceF[F[_]](bindings: ModuleBase, roots: Roots)(implicit arg0: TagK[F], arg1: DIEffect[F]): DIResourceBase[F, Locator]
  24. final def produceF[F[_]](input: PlannerInput)(implicit arg0: TagK[F], arg1: DIEffect[F]): DIResourceBase[F, Locator]

    Create an effectful izumi.distage.model.definition.DIResource value that encapsulates the allocation and cleanup of an object graph described by input

    Create an effectful izumi.distage.model.definition.DIResource value that encapsulates the allocation and cleanup of an object graph described by input

    class HelloWorld { def hello() = println("hello world") }
    
    Injector()
      .produceGet[HelloWorld](new ModuleDef {
        make[HelloWorld]
      })(_.hello())
    input

    Bindings created by izumi.distage.model.definition.ModuleDef DSL and garbage collection roots. Garbage collector will remove all bindings that aren't direct or indirect dependencies of the chosen root DIKeys from the plan - they will never be instantiated. If left empty, garbage collection will not be performed – that would be equivalent to designating all DIKeys as roots.

    returns

    A Resource value that encapsulates allocation and cleanup of the object graph described by input

  25. final def produceF[F[_]](plan: OrderedPlan)(implicit arg0: TagK[F], arg1: DIEffect[F]): DIResourceBase[F, Locator]
    Definition Classes
    Producer
  26. final def produceGet[A](name: String)(bindings: ModuleBase)(implicit arg0: Tag[A]): DIResourceBase[Identity, A]
  27. final def produceGet[A](bindings: ModuleBase)(implicit arg0: Tag[A]): DIResourceBase[Identity, A]
  28. final def produceGetF[F[_], A](name: String)(bindings: ModuleBase)(implicit arg0: TagK[F], arg1: DIEffect[F], arg2: Tag[A]): DIResourceBase[F, A]
  29. final def produceGetF[F[_], A](bindings: ModuleBase)(implicit arg0: TagK[F], arg1: DIEffect[F], arg2: Tag[A]): DIResourceBase[F, A]

    Create an effectful izumi.distage.model.definition.DIResource value that encapsulates the allocation and cleanup of an object graph described by the input module, designate A as the root of the graph and retrieve A from the result.

    Create an effectful izumi.distage.model.definition.DIResource value that encapsulates the allocation and cleanup of an object graph described by the input module, designate A as the root of the graph and retrieve A from the result.

    class HelloWorld { def hello() = println("hello world") }
    
    Injector()
      .produceGet[HelloWorld](new ModuleDef {
        make[HelloWorld]
      })(_.hello())

    This is useful for the common case when your main logic class is the root of your graph AND the object you want to use immediately.

    Injector().produceGetF[F, A](moduleDef) is a short-hand for:

    Injector()
      .produceF[F](moduleDef, GCMode(DIKey.get[A]))
      .map(_.get[A])
  30. final def produceRun[A](bindings: ModuleBase)(function: ProviderMagnet[A])(implicit arg0: Tag[A]): A
  31. final def produceRunF[F[_], A](bindings: ModuleBase)(function: ProviderMagnet[F[A]])(implicit arg0: TagK[F], arg1: DIEffect[F]): F[A]

    Create an an object graph described by the input module, designate all arguments of the provided function as roots of the graph and run the function, deallocating the object graph when the function exits.

    Create an an object graph described by the input module, designate all arguments of the provided function as roots of the graph and run the function, deallocating the object graph when the function exits.

    class Hello { def hello() = println("hello") }
    class World { def world() = println("world") }
    
    Injector()
      .produceRun(new ModuleDef {
        make[Hello]
        make[World]
      }) {
        (hello: Hello, world: World) =>
          hello.hello()
          world.world()
      }

    This is useful for the common case when you want to run an effect using the produced objects from the object graph and deallocate the object graph once the effect is finished

    Injector().produceRunF[F, A](moduleDef)(fn) is a short-hand for:

    Injector()
      .produceF[F](moduleDef, GCMode(fn.get.diKeys.toSet))
      .use(_.run(fn))
  32. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  33. def toString(): String
    Definition Classes
    AnyRef → Any
  34. final def trisectByKeys(appModule: ModuleBase, primaryRoots: Set[DIKey])(extractSubRoots: (OrderedPlan) => Set[DIKey]): TriSplittedPlan
    Definition Classes
    PlanSplittingOps
  35. final def trisectByRoots(appModule: ModuleBase, primaryRoots: Set[DIKey], subplanRoots: Set[DIKey]): TriSplittedPlan
    Definition Classes
    PlanSplittingOps
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Producer

Inherited from Planner

Inherited from PlanSplittingOps

Inherited from AnyRef

Inherited from Any

Ungrouped