MCPcopy Create free account
hub / github.com/Effect-TS/effect / withRuntimeFlagsScoped

Function withRuntimeFlagsScoped

packages/effect/src/internal/fiberRuntime.ts:3190–3209  ·  view source on GitHub ↗
(
  update: RuntimeFlagsPatch.RuntimeFlagsPatch
)

Source from the content-addressed store, hash-verified

3188
3189/* @internal */
3190export const withRuntimeFlagsScoped = (
3191 update: RuntimeFlagsPatch.RuntimeFlagsPatch
3192): Effect.Effect<void, never, Scope.Scope> => {
3193 if (update === RuntimeFlagsPatch.empty) {
3194 return core.void
3195 }
3196 return pipe(
3197 core.runtimeFlags,
3198 core.flatMap((runtimeFlags) => {
3199 const updatedRuntimeFlags = runtimeFlags_.patch(runtimeFlags, update)
3200 const revertRuntimeFlags = runtimeFlags_.diff(updatedRuntimeFlags, runtimeFlags)
3201 return pipe(
3202 core.updateRuntimeFlags(update),
3203 core.zipRight(addFinalizer(() => core.updateRuntimeFlags(revertRuntimeFlags))),
3204 core.asVoid
3205 )
3206 }),
3207 core.uninterruptible
3208 )
3209}
3210
3211// circular with Scope
3212

Callers

nothing calls this directly

Calls 4

pipeFunction · 0.70
addFinalizerFunction · 0.70
patchMethod · 0.65
diffMethod · 0.65

Tested by

no test coverage detected