Package: effect
Module: TxPriorityQueue
Takes the smallest element from the queue. Retries if the queue is empty.
Example (Taking the next value)
import { Effect, Order, TxPriorityQueue } from "effect"
const program = Effect.gen(function*() {
const pq = yield* TxPriorityQueue.fromIterable(Order.Number, [3, 1, 2])
const first = yield* TxPriorityQueue.take(pq)
console.log(first) // 1
})
Signature
declare const take: <A>(self: TxPriorityQueue<A>) => Effect.Effect<A>
Since v2.0.0