Skip to content

Commit

Permalink
Add a clarifying comment for `make[List[ZLayer[Any, Nothing, Any]]].n…
Browse files Browse the repository at this point in the history
…amed("zio-runtime-configuration")` binding
  • Loading branch information
neko-kai committed Jan 24, 2025
1 parent f45744f commit a067896
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ class ZIOSupportModule[R: Tag] extends ZIOPlatformDependentSupportModule[R] {

addImplicit[TagK3[ZIO]]

// The Runtime ZLayers (such as those found in zio.Runtime.* or zio.test.*)
// used to configure the ZIO runtime and associated magic FiberRefs.
// You can override this binding in user code to provide your own configuration,
// e.g. to obtain TestClock from zio-test:
// {{{
// make[List[ZLayer[Any, Nothing, Any]]].named("zio-runtime-configuration").from {
// List(zio.test.testEnvironment)
// }
// }}}
make[List[ZLayer[Any, Nothing, Any]]].named("zio-runtime-configuration").fromValue(Nil)

// assume default environment is `Any`, otherwise let the error message guide the user here.
make[ZEnvironment[Any]].named("zio-initial-env").fromValue(ZEnvironment.empty)

Expand All @@ -63,7 +74,6 @@ class ZIOSupportModule[R: Tag] extends ZIOPlatformDependentSupportModule[R] {
)
}
make[FailureHandler].fromValue(FailureHandler.Default)
make[List[ZLayer[Any, Nothing, Any]]].named("zio-runtime-configuration").fromValue(Nil)

make[Executor].named("io").from {
// no reason to use custom blocking pool, since this one is hardcoded in zio.internal.ZScheduler.submitBlocking
Expand Down

0 comments on commit a067896

Please sign in to comment.