MCPcopy
hub / github.com/Effect-TS/effect / worker

Function worker

packages/effect/test/Fiber.test.ts:144–149  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

142 )
143 }
144 const worker = (n: number) => {
145 if (n === 100) {
146 return pipe(Queue.shutdown(queue), Effect.zipRight(Effect.fail("fail")))
147 }
148 return pipe(Queue.offer(queue, n), Effect.asVoid)
149 }
150 const queue = yield* Queue.unbounded<number>()
151 yield* Queue.offerAll(queue, Array.range(1, 100))
152 const result = yield* Effect.exit(shard(queue, 4, worker))

Callers 1

shardFunction · 0.70

Calls 4

pipeFunction · 0.90
failMethod · 0.65
offerMethod · 0.65
shutdownMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…