Attributes
- bootstrapLocator
contains Planner & PlanInterpeter built using a
BootstrapModule
, most often created using izumi.distage.bootstrap.BootstrapLocator.bootstrap- defaultModule
is added to (but overridden by) user's PlannerInput
- parentFactory
passed-through for summoning in DI as
InjectorFactory
/ field inBootloader
- Companion:
- object
- Graph
- Supertypes
Members list
Value members
Concrete methods
Attributes
- Definition Classes
- Planner
Does the same job as plan but does not apply any binding rewrites (autocloseables, resources, etc) Most likely you won't need to call this method directly.
Does the same job as plan but does not apply any binding rewrites (autocloseables, resources, etc) Most likely you won't need to call this method directly.
Attributes
- Definition Classes
- Planner
Attributes
- Definition Classes
Keys that will be available to the module interpreted by this Injector, includes parent Locator keys, izumi.distage.modules.DefaultModule & Injector's self-reference keys
Keys that will be available to the module interpreted by this Injector, includes parent Locator keys, izumi.distage.modules.DefaultModule & Injector's self-reference keys
Attributes
- Definition Classes
Attributes
- Definition Classes
- Planner
Inherited methods
Efficiently check all possible paths for the given module to the given roots
,
Efficiently check all possible paths for the given module to the given roots
,
This is a "raw" version of izumi.distage.framework.PlanCheck API, please use PlanCheck
for all non-exotic needs.
This method executes at runtime, to check correctness at compile-time use PlanCheck
API from distage-framework
module.
Attributes
- Returns:
Unit
- Throws:
- PlanCheckException
on found issues
- See also:
- Inherited from:
- Injector
Attributes
- Inherited from:
- Planner
Attributes
- Inherited from:
- Planner
Attributes
- Inherited from:
- Planner
Create an effectful izumi.distage.model.definition.Lifecycle value that encapsulates the
allocation and cleanup of an object graph described by an existing plan
Create an effectful izumi.distage.model.definition.Lifecycle value that encapsulates the
allocation and cleanup of an object graph described by an existing plan
class HelloWorld {
def hello() = println("hello world")
}
val injector = Injector()
val plan = injector.plan(PlannerInput(
bindings = new ModuleDef {
make[HelloWorld]
},
activation = Activation.empty,
roots = Roots.target[HelloWorld],
)).getOrThrow()
injector
.produce(plan)
.use(_.get[HelloWorld].hello())
Attributes
Attributes
- Inherited from:
- Injector
Create an effectful izumi.distage.model.definition.Lifecycle value that encapsulates the
allocation and cleanup of an object graph described by input
Create an effectful izumi.distage.model.definition.Lifecycle value that encapsulates the
allocation and cleanup of an object graph described by input
class HelloWorld {
def hello() = println("hello world")
}
Injector()
.produce(PlannerInput(
bindings = new ModuleDef {
make[HelloWorld]
},
activation = Activation.empty,
roots = Roots.target[HelloWorld],
))
.use(_.get[HelloWorld].hello())
Attributes
- 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
- Inherited from:
- Injector
Produce izumi.distage.model.Locator interpreting effect and resource bindings into the provided effect type
Produce izumi.distage.model.Locator interpreting effect and resource bindings into the provided effect type
Attributes
- Inherited from:
- Injector
Produce izumi.distage.model.Locator interpreting effect- and resource-bindings into the provided F
Produce izumi.distage.model.Locator interpreting effect- and resource-bindings into the provided F
Attributes
- Inherited from:
- Producer
Produce izumi.distage.model.Locator, supporting only effect and resource bindings in Identity
Produce izumi.distage.model.Locator, supporting only effect and resource bindings in Identity
Attributes
- Inherited from:
- Injector
Produce izumi.distage.model.Locator, supporting only effect- and resource-bindings in Identity
Produce izumi.distage.model.Locator, supporting only effect- and resource-bindings in Identity
Attributes
- Inherited from:
- Producer
Attributes
- Inherited from:
- Injector
Attributes
- Inherited from:
- Producer
Attributes
- Inherited from:
- Injector
Attributes
- Inherited from:
- Producer
Create an effectful izumi.distage.model.definition.Lifecycle 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.Lifecycle 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.world()
}
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[F]().produceEval[A](moduleDef)(fn)
is a short-hand for:
Injector[F]()
.produce(moduleDef, Roots(fn.get.diKeys.toSet))
.evalMap(_.run(fn)): Lifecycle[F, A]
Attributes
- activation
A map of axes of configuration to choices along these axes
- bindings
Bindings created by izumi.distage.model.definition.ModuleDef DSL
- function
N-ary izumi.distage.model.providers.Functoid function for which arguments will be designated as roots and provided from the object graph
- Inherited from:
- Injector
Attributes
- Inherited from:
- Injector
Attributes
- Inherited from:
- Injector
Create an effectful izumi.distage.model.definition.Lifecycle 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.Lifecycle 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]
})
.use(_.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[F]().produceGet[A](moduleDef)
is a short-hand for:
Injector[F]()
.produce(moduleDef, Roots(DIKey.get[A]))
.map(_.get[A]): Lifecycle[F, A]
Attributes
- activation
A map of axes of configuration to choices along these axes
- bindings
Bindings created by izumi.distage.model.definition.ModuleDef DSL
- Inherited from:
- Injector
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[F]().produceRun[A](moduleDef)(fn)
is a short-hand for:
Injector[F]()
.produce(moduleDef, Roots(fn.get.diKeys.toSet))
.use(_.run(fn)): F[A]
Attributes
- activation
A map of axes of configuration to choices along these axes
- bindings
Bindings created by izumi.distage.model.definition.ModuleDef DSL
- function
N-ary izumi.distage.model.providers.Functoid function for which arguments will be designated as roots and provided from the object graph
- Inherited from:
- Injector
Efficiently check all possible paths for the given module to the given roots
,
Efficiently check all possible paths for the given module to the given roots
,
This is a "raw" version of izumi.distage.framework.PlanCheck API, please use PlanCheck
for all non-exotic needs.
This method executes at runtime, to check correctness at compile-time use PlanCheck
API from distage-framework
module.
Attributes
- Returns:
Set of issues if any.
- Throws:
- Nothing
Does not throw.
- See also:
- Inherited from:
- Injector