MakeFromZIOZEnv
Attributes
- Graph
-
- Supertypes
-
class AnyValtrait Matchableclass Any
Members list
Value members
Concrete methods
Bind to a Lifecycle class which has a ZIO effect type that specifies dependencies via zio environment, e.g.
Bind to a Lifecycle class which has a ZIO effect type that specifies dependencies via zio environment, e.g.
class IntLifecycle extends Lifecycle.OfZIO[Double, Nothing, Int](
for {
double <- ZIO.service[Double]
_ <- ZIO.acquireRelease(ZIO.unit)(_ => ZIO.succeed(println("Closed")))
} yield double.toInt
)
val module = new ModuleDef {
make[Int].fromZEnvLifecycle[IntLifecycle]
make[Double].from(5.0)
}
Injector[Task]().produceRun(module) {
(i: Int) => ZIO.succeed(println(i))
}
// 5
// Closed
Warning: removes the precise subtype of Lifecycle because of Lifecycle.map
: Integration checks mixed-in as a trait onto a Lifecycle value result here will be lost
Attributes
Bind to a Lifecycle value which has a ZIO effect type that specifies dependencies via zio environment
Bind to a Lifecycle value which has a ZIO effect type that specifies dependencies via zio environment
Warning: removes the precise subtype of Lifecycle because of Lifecycle.map
: Integration checks mixed-in as a trait onto a Lifecycle value result here will be lost
Attributes
Bind to a Lifecycle value which has a ZIO effect type that specifies dependencies via zio environment
Bind to a Lifecycle value which has a ZIO effect type that specifies dependencies via zio environment
Warning: removes the precise subtype of Lifecycle because of Lifecycle.map
: Integration checks mixed-in as a trait onto a Lifecycle value result here will be lost