Hyperlinkv0.8.0-beta.28

Effect

Effect.fiberIdconsteffect/Effect.ts:8774
Effect<number, never, never>

Accesses the current fiber id executing the effect.

Example (Accessing the current fiber id)

import { Effect } from "effect"

const program = Effect.log("event").pipe(
  // Read the current span with the fiber id for tagging.
  Effect.andThen(Effect.all([Effect.currentSpan, Effect.fiberId])),
  Effect.withSpan("A"),
  Effect.map(([span, fiberId]) => ({
    spanName: span.name,
    fiberId
  }))
)
supervision & fibers
Source effect/Effect.ts:87741 lines
export const fiberId: Effect<number> = internal.fiberId