MCPcopy Create free account
hub / github.com/Effect-TS/effect / withYield

Function withYield

packages/effect/test/Queue.test.ts:8–9  ·  view source on GitHub ↗
(effect: Effect.Effect<A, E>)

Source from the content-addressed store, hash-verified

6 describe("waiter registration after a yield", () => {
7 // Budget 3 yields after the first queue check but before the old waiter registration.
8 const withYield = <A, E>(effect: Effect.Effect<A, E>) =>
9 Effect.provideService(effect, Scheduler.MaxOpsBeforeYield, 3)
10
11 const assertCompletes = Effect.fnUntraced(function*(fiber: Fiber.Fiber<unknown, unknown>) {
12 for (let i = 0; i < 200 && fiber.pollUnsafe() === undefined; i++) yield* Effect.yieldNow

Callers 1

Queue.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected