MCPcopy Create free account
hub / github.com/effect-app/libs / poll

Function poll

repos/effect/packages/effect/src/Queue.ts:1434–1444  ·  view source on GitHub ↗
(self: Dequeue<A, E>)

Source from the content-addressed store, hash-verified

1432 * Attempts to take one item from the queue without waiting.
1433 *
1434 * **Details**
1435 *
1436 * Returns `Option.some` when an item is immediately available. Returns
1437 * `Option.none` when no item is available, when the queue is done, or when the
1438 * immediate take observes a queue failure.
1439 *
1440 * **Example** (Polling without blocking)
1441 *
1442 * ```ts import.meta.vitest
1443 * import { Effect, Option, Queue } from "effect"
1444 *
1445 * const program = Effect.gen(function*() {
1446 * const queue = yield* Queue.bounded<number>(10)
1447 *

Callers

nothing calls this directly

Calls 3

takeUnsafeFunction · 0.85
someMethod · 0.80
succeedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…