MCPcopy Index your code
hub / github.com/Effect-TS/effect / withRuntimeFlagsScoped

Function withRuntimeFlagsScoped

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

Source from the content-addressed store, hash-verified

3178
3179/* @internal */
3180export const withRuntimeFlagsScoped = (
3181 update: RuntimeFlagsPatch.RuntimeFlagsPatch
3182): Effect.Effect<void, never, Scope.Scope> => {
3183 if (update === RuntimeFlagsPatch.empty) {
3184 return core.void
3185 }
3186 return pipe(
3187 core.runtimeFlags,
3188 core.flatMap((runtimeFlags) => {
3189 const updatedRuntimeFlags = runtimeFlags_.patch(runtimeFlags, update)
3190 const revertRuntimeFlags = runtimeFlags_.diff(updatedRuntimeFlags, runtimeFlags)
3191 return pipe(
3192 core.updateRuntimeFlags(update),
3193 core.zipRight(addFinalizer(() => core.updateRuntimeFlags(revertRuntimeFlags))),
3194 core.asVoid
3195 )
3196 }),
3197 core.uninterruptible
3198 )
3199}
3200
3201// circular with Scope
3202

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