(self: TxQueueState): Effect.Effect<boolean>Checks whether the queue is shutdown (legacy compatibility).
Example (Checking shutdown state)
import { Effect, TxQueue } from "effect"
const program = Effect.gen(function*() {
const queue = yield* TxQueue.bounded<number>(10)
const isShutdown = yield* TxQueue.isShutdown(queue)
console.log(isShutdown) // false
yield* TxQueue.shutdown(queue)
const nowShutdown = yield* TxQueue.isShutdown(queue)
console.log(nowShutdown) // true
})export const const isShutdown: (
self: TxQueueState
) => Effect.Effect<boolean>
Checks whether the queue is shutdown (legacy compatibility).
Example (Checking shutdown state)
import { Effect, TxQueue } from "effect"
const program = Effect.gen(function*() {
const queue = yield* TxQueue.bounded<number>(10)
const isShutdown = yield* TxQueue.isShutdown(queue)
console.log(isShutdown) // false
yield* TxQueue.shutdown(queue)
const nowShutdown = yield* TxQueue.isShutdown(queue)
console.log(nowShutdown) // true
})
isShutdown = (self: TxQueueState(parameter) self: {
strategy: "bounded" | "unbounded" | "dropping" | "sliding";
capacity: number;
items: TxChunk.TxChunk<any>;
stateRef: TxRef.TxRef<State<any, any>>;
toString: () => string;
toJSON: () => unknown;
}
self: TxQueueState): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<boolean> => const isDone: (
self: TxQueueState
) => Effect.Effect<boolean>
Checks whether the queue is done (completed or failed).
Example (Checking done state)
import { Effect, TxQueue } from "effect"
const program = Effect.gen(function*() {
const queue = yield* TxQueue.bounded<number>(10)
const done = yield* TxQueue.isDone(queue)
console.log(done) // false
yield* TxQueue.interrupt(queue)
const nowDone = yield* TxQueue.isDone(queue)
console.log(nowDone) // true
})
isDone(self: TxQueueState(parameter) self: {
strategy: "bounded" | "unbounded" | "dropping" | "sliding";
capacity: number;
items: TxChunk.TxChunk<any>;
stateRef: TxRef.TxRef<State<any, any>>;
toString: () => string;
toJSON: () => unknown;
}
self)