effect-io-ai

Package: effect
Module: FiberHandle

FiberHandle.join

If any of the Fiber’s in the handle terminate with a failure, the returned Effect will terminate with the first failure that occurred.

Example

import { Effect, FiberHandle } from "effect";

Effect.gen(function* (_) {
  const handle = yield* _(FiberHandle.make());
  yield* _(FiberHandle.set(handle, Effect.runFork(Effect.fail("error"))));

  // parent fiber will fail with "error"
  yield* _(FiberHandle.join(handle));
});

Signature

declare const join: <A, E>(self: FiberHandle<A, E>) => Effect.Effect<void, E>

Source

Since v2.0.0