(self: Dequeue<A, E>)
| 1557 | * @since 2.0.0 |
| 1558 | */ |
| 1559 | export const poll = <A, E>(self: Dequeue<A, E>): Effect<Option.Option<A>> => |
| 1560 | suspendTake(() => { |
| 1561 | const result = takeUnsafe(self) |
| 1562 | if (result === undefined) { |
| 1563 | return internalEffect.succeed(Option.none()) |
| 1564 | } |
| 1565 | if (result._tag === "Success") { |
| 1566 | return internalEffect.succeed(Option.some(result.value)) |
| 1567 | } |
| 1568 | return internalEffect.succeed(Option.none()) |
| 1569 | }) |
| 1570 | |
| 1571 | /** |
| 1572 | * Peeks at the next item without removing it. |
nothing calls this directly
no test coverage detected