Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/shared/src/main/scala/zio/Runtime.scala
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ object Runtime extends RuntimePlatformSpecific {
def setBlockingExecutor(executor: Executor)(implicit trace: Trace): ZLayer[Any, Nothing, Unit] =
ZLayer.scoped(FiberRef.currentBlockingExecutor.locallyScoped(executor))

def setConfigProvider(configProvider: ConfigProvider)(implicit trace: Trace): ZLayer[Any, Nothing, Unit] =
ZLayer.scoped(ZIO.withConfigProviderScoped(configProvider))

def setExecutor(executor: Executor)(implicit trace: Trace): ZLayer[Any, Nothing, Unit] =
ZLayer.scoped(FiberRef.overrideExecutor.locallyScoped(Some(executor)))

Expand Down
2 changes: 1 addition & 1 deletion test/shared/src/main/scala/zio/test/TestAspect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ object TestAspect extends TimeoutVariants {
def withConfigProvider(configProvider: ConfigProvider): TestAspectPoly =
new TestAspectPoly {
def some[R, E](spec: Spec[R, E])(implicit trace: Trace): Spec[R, E] =
spec.provideSomeLayer[R](ZLayer.scoped(ZIO.withConfigProviderScoped(configProvider)))
spec.provideSomeLayer[R](Runtime.setConfigProvider(configProvider))
}

/**
Expand Down