If I have an instance of ZIO Runtime
, how do I apply ZLayer
s (such as the new enableAutoBlockingExecutor
in ZIO 2.1) to it to get a modified Runtime
?
I see that Runtime
has a withEnvironment
method, but I am not sure how to create a ZEnvironment
from ZLayer
s.
(My application doesn’t extend ZIOAppDefault
, so I don’t have a bootstrap
method, or use ZLayer
s anywhere else. In parts of the system that use ZIO, effects are run manually where needed using runtime.unsafe.run
from the Runtime
I am attempting to construct.)