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

Function deferredInterruptJoiner

packages/effect/src/internal/core.ts:3001–3014  ·  view source on GitHub ↗
(
  self: Deferred.Deferred<A, E>,
  joiner: (effect: Effect.Effect<A, E>) => void
)

Source from the content-addressed store, hash-verified

2999}
3000
3001const deferredInterruptJoiner = <A, E>(
3002 self: Deferred.Deferred<A, E>,
3003 joiner: (effect: Effect.Effect<A, E>) => void
3004): Effect.Effect<void> =>
3005 sync(() => {
3006 const state = MutableRef.get(self.state)
3007 if (state._tag === DeferredOpCodes.OP_STATE_PENDING) {
3008 const index = state.joiners.indexOf(joiner)
3009 if (index >= 0) {
3010 // we can splice here as the internal state is mutable
3011 state.joiners.splice(index, 1)
3012 }
3013 }
3014 })
3015
3016// -----------------------------------------------------------------------------
3017// Context

Callers 1

deferredAwaitFunction · 0.85

Calls 2

syncFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected