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

Function completeRace

packages/effect/src/internal/fiberRuntime.ts:3681–3691  ·  view source on GitHub ↗
(
  winner: Fiber.RuntimeFiber<any, any>,
  loser: Fiber.RuntimeFiber<any, any>,
  cont: (winner: Fiber.RuntimeFiber<any, any>, loser: Fiber.RuntimeFiber<any, any>) => Effect.Effect<any, any, any>,
  ab: MRef.MutableRef<boolean>,
  cb: (_: Effect.Effect<A2 | A3, E2 | E3, R | R1 | R2 | R3>) => void
)

Source from the content-addressed store, hash-verified

3679 }))
3680
3681const completeRace = <A2, A3, E2, E3, R, R1, R2, R3>(
3682 winner: Fiber.RuntimeFiber<any, any>,
3683 loser: Fiber.RuntimeFiber<any, any>,
3684 cont: (winner: Fiber.RuntimeFiber<any, any>, loser: Fiber.RuntimeFiber<any, any>) => Effect.Effect<any, any, any>,
3685 ab: MRef.MutableRef<boolean>,
3686 cb: (_: Effect.Effect<A2 | A3, E2 | E3, R | R1 | R2 | R3>) => void
3687): void => {
3688 if (MRef.compareAndSet(true, false)(ab)) {
3689 cb(cont(winner, loser))
3690 }
3691}
3692
3693/** @internal */
3694export const ensuring: {

Callers 1

fiberRuntime.tsFile · 0.85

Calls 1

contFunction · 0.85

Tested by

no test coverage detected