Package: effect
Module: Effect
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
}))
)
Signature
declare const fiberId: Effect<number, never, never>
Since v2.0.0