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

Function asyncIO

packages/effect/test/Effect/async.test.ts:35–43  ·  view source on GitHub ↗
(cont: Effect.Effect<number>)

Source from the content-addressed store, hash-verified

33 it.effect("deep asyncEffect doesn't block", () =>
34 Effect.gen(function*() {
35 const asyncIO = (cont: Effect.Effect<number>): Effect.Effect<number> => {
36 return Effect.asyncEffect((cb) => {
37 return pipe(
38 Effect.sleep(Duration.millis(5)),
39 Effect.zipRight(cont),
40 Effect.zipRight(Effect.succeed(cb(Effect.succeed(42))))
41 )
42 })
43 }
44 const stackIOs = (count: number): Effect.Effect<number> => {
45 return count < 0 ? Effect.succeed(42) : asyncIO(stackIOs(count - 1))
46 }

Callers 1

stackIOsFunction · 0.85

Calls 2

sleepMethod · 0.65
pipeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…