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

Function plus1

packages/effect/test/Effect/concurrency.test.ts:87–93  ·  view source on GitHub ↗
(latch: Deferred.Deferred<void, never>, finalizer: Effect.Effect<X>)

Source from the content-addressed store, hash-verified

85 it.effect("daemon fiber race interruption", () =>
86 Effect.gen(function*() {
87 const plus1 = <X>(latch: Deferred.Deferred<void, never>, finalizer: Effect.Effect<X>) => {
88 return pipe(
89 Deferred.succeed(latch, void 0),
90 Effect.zipRight(Effect.sleep(Duration.hours(1))),
91 Effect.onInterrupt(() => pipe(finalizer, Effect.map((x) => x)))
92 )
93 }
94 const interruptionRef = yield* (Ref.make(0))
95 const latch1Start = yield* (Deferred.make<void>())
96 const latch2Start = yield* (Deferred.make<void>())

Callers 1

Calls 3

sleepMethod · 0.65
mapMethod · 0.65
pipeFunction · 0.50

Tested by

no test coverage detected