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

Function child

packages/effect/test/Effect/concurrency.test.ts:69–77  ·  view source on GitHub ↗
(ref: Ref.Ref<boolean>)

Source from the content-addressed store, hash-verified

67 it.effect("daemon fiber is unsupervised", () =>
68 Effect.gen(function*() {
69 const child = (ref: Ref.Ref<boolean>) => {
70 return withLatch((release) =>
71 pipe(
72 release,
73 Effect.zipRight(Effect.never),
74 Effect.ensuring(Ref.set(ref, true))
75 )
76 )
77 }
78 const ref = yield* (Ref.make(false))
79 const fiber1 = yield* pipe(child(ref), Effect.forkDaemon, Effect.fork)
80 const fiber2 = yield* (Fiber.join(fiber1))

Callers 1

Calls 3

withLatchFunction · 0.85
setMethod · 0.65
pipeFunction · 0.50

Tested by

no test coverage detected