<A = unknown, E = unknown>(u: unknown): u is TxDequeue<A, E>Checks whether the given value is a TxDequeue.
Example (Checking dequeue handles)
import { TxQueue } from "effect"
declare const someValue: unknown
if (TxQueue.isTxDequeue(someValue)) {
// someValue is now typed as TxDequeue<unknown, unknown>
console.log("This is a TxDequeue")
}guards
Source effect/TxQueue.ts:2881 lines
export const const isTxDequeue: <
A = unknown,
E = unknown
>(
u: unknown
) => u is TxDequeue<A, E>
Checks whether the given value is a TxDequeue.
Example (Checking dequeue handles)
import { TxQueue } from "effect"
declare const someValue: unknown
if (TxQueue.isTxDequeue(someValue)) {
// someValue is now typed as TxDequeue<unknown, unknown>
console.log("This is a TxDequeue")
}
isTxDequeue = <function (type parameter) A in <A = unknown, E = unknown>(u: unknown): u is TxDequeue<A, E>A = unknown, function (type parameter) E in <A = unknown, E = unknown>(u: unknown): u is TxDequeue<A, E>E = unknown>(u: unknownu: unknown): u: unknownu is interface TxDequeue<out A, out E = never>Namespace containing type definitions for TxDequeue variance annotations.
A TxDequeue represents the read-only interface of a transactional queue, providing
operations for consuming elements (dequeue operations) and inspecting queue state.
Example (Taking values through dequeue handles)
import { Effect, TxQueue } from "effect"
const program = Effect.gen(function*() {
// Queue without error channel
const queue = yield* TxQueue.bounded<number>(10)
yield* TxQueue.offer(queue, 42)
const item = yield* TxQueue.take(queue)
console.log(item) // 42
// Queue with error channel - errors propagate through E-channel
const faultTolerantQueue = yield* TxQueue.bounded<number, string>(10)
yield* TxQueue.fail(faultTolerantQueue, "processing failed")
// All dequeue operations now fail with the error directly
const takeResult = yield* Effect.flip(TxQueue.take(faultTolerantQueue)) // "processing failed"
const peekResult = yield* Effect.flip(TxQueue.peek(faultTolerantQueue)) // "processing failed"
})
TxDequeue<function (type parameter) A in <A = unknown, E = unknown>(u: unknown): u is TxDequeue<A, E>A, function (type parameter) E in <A = unknown, E = unknown>(u: unknown): u is TxDequeue<A, E>E> => import hasPropertyhasProperty(u: unknownu, const DequeueTypeId: "~effect/transactions/TxQueue/Dequeue"DequeueTypeId)