QueueHyperlink<Payload, Success, Error, Requirements>A queue handle — the value yield* MyQueue produces. The named compact form of a queue's
service (both the light Tag path and the engine-included Service path yield this one type), so
it hovers as QueueHyperlink<EmailJob> instead of an expanded member wall; prettify-ts / the docs
D3 popover expand it to the full shape on demand.
export interface interface QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>A queue handle — the value yield* MyQueue produces. The named compact form of a queue's
service (both the light Tag path and the engine-included Service path yield this one type), so
it hovers as QueueHyperlink<EmailJob> instead of an expanded member wall; prettify-ts / the docs
D3 popover expand it to the full shape on demand.
QueueHyperlink<
function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload,
function (type parameter) Success in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Success = void,
function (type parameter) Error in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Error = never,
function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements = never,
> {
/** Live current-state snapshot (per-priority sizes, paused, in-flight, completed, phase). */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.status: Hyperlink.Subscribable<QueueStatus>Live current-state snapshot (per-priority sizes, paused, in-flight, completed, phase).
status: import HyperlinkHyperlink.type Hyperlink.Subscribable = /*unresolved*/ anySubscribable<import QueueStatusQueueStatus>;
/** Total pending items across all priority levels. */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.size: Hyperlink.Subscribable<number>Total pending items across all priority levels.
size: import HyperlinkHyperlink.type Hyperlink.Subscribable = /*unresolved*/ anySubscribable<number>;
/** Whether all priority queues are empty. */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.isEmpty: Hyperlink.Subscribable<boolean>Whether all priority queues are empty.
isEmpty: import HyperlinkHyperlink.type Hyperlink.Subscribable = /*unresolved*/ anySubscribable<boolean>;
/** Fork the worker pool + lifecycle monitor (idempotent; no-op after shutdown). */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.start: Effect.Effect<void, never, Requirements>(property) QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.start: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Fork the worker pool + lifecycle monitor (idempotent; no-op after shutdown).
start: 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<void, never, function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements>;
/** Pause processing; items can still be enqueued and accumulate. */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.pause: Effect.Effect<void, never, never>(property) QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.pause: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Pause processing; items can still be enqueued and accumulate.
pause: 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<void>;
/** Resume processing after a pause. */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.resume: Effect.Effect<void, never, never>(property) QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.resume: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Resume processing after a pause.
resume: 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<void>;
/** Permanently stop the queue (graceful drain). */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.shutdown: Effect.Effect<void, never, never>(property) QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.shutdown: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Permanently stop the queue (graceful drain).
shutdown: 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<void>;
/** Drain all pending items and reset the completed counter; returns the count cleared. */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.clear: Effect.Effect<number, never, Requirements>(property) QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.clear: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Drain all pending items and reset the completed counter; returns the count cleared.
clear: 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<number, never, function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements>;
/** Windowed metrics: the live `stream` plus a historical `query` (needs a HistoryStore). */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.metrics: {
readonly stream: Stream.Stream<QueueMetrics>;
readonly query: (input: {
readonly limit?: number;
readonly since?: DateTime.Utc;
readonly until?: DateTime.Utc;
}) => Effect.Effect<ReadonlyArray<QueueMetrics>, never, Requirements>;
}
Windowed metrics: the live stream plus a historical query (needs a HistoryStore).
metrics: {
readonly stream: Stream.Stream<
QueueMetrics,
never,
never
>
(property) stream: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
stream: import StreamStream.interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<import QueueMetricsQueueMetrics>;
readonly query: (input: {
readonly limit?: number
readonly since?: DateTime.Utc
readonly until?: DateTime.Utc
}) => Effect.Effect<
ReadonlyArray<QueueMetrics>,
never,
Requirements
>
query: (input: {
readonly limit?: number
readonly since?: DateTime.Utc
readonly until?: DateTime.Utc
}
input: {
readonly limit?: number | undefinedlimit?: number;
readonly since?: DateTime.Utc | undefinedsince?: import DateTimeDateTime.Utc;
readonly until?: DateTime.Utc | undefineduntil?: import DateTimeDateTime.Utc;
}) => 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<interface ReadonlyArray<T>ReadonlyArray<import QueueMetricsQueueMetrics>, never, function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements>;
};
/** Enqueue an item (or a batch) at normal priority. */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.add: QueueEnqueue<Payload, never, Requirements>Enqueue an item (or a batch) at normal priority.
add: import QueueEnqueueQueueEnqueue<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload, never, function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements>;
/** Enqueue at high priority (processed before normal and low). */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.prioritize: QueueEnqueue<Payload, never, Requirements>Enqueue at high priority (processed before normal and low).
prioritize: import QueueEnqueueQueueEnqueue<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload, never, function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements>;
/** Enqueue at low priority (processed after high and normal). */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.defer: QueueEnqueue<Payload, never, Requirements>Enqueue at low priority (processed after high and normal).
defer: import QueueEnqueueQueueEnqueue<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload, never, function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements>;
/** Re-inject existing entries (each re-enters at its own priority with attempts preserved). */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.enqueue: (entries: ReadonlyArray<QueueEntry<Payload>>) => Effect.Effect<void, never, Requirements>Re-inject existing entries (each re-enters at its own priority with attempts preserved).
enqueue: (
entries: readonly QueueEntry<Payload>[]entries: interface ReadonlyArray<T>ReadonlyArray<import QueueEntryQueueEntry<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload>>,
) => 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<void, never, function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements>;
/** Export pending entries for handoff and remove them; returns them decoded. */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.release: (input: {
readonly options?: QueueReleaseOptions;
}) => Effect.Effect<ReadonlyArray<QueueEntry<Payload>>, never, Requirements>
Export pending entries for handoff and remove them; returns them decoded.
release: (input: {
readonly options?: QueueReleaseOptions
}
input: {
readonly options?: anyoptions?: import QueueReleaseOptionsQueueReleaseOptions;
}) => 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<interface ReadonlyArray<T>ReadonlyArray<import QueueEntryQueueEntry<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload>>, never, function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements>;
/** Export pending entries in encoded/wire form for remote handoff (requires an itemSchema). */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.releaseEncoded: (input: { readonly options?: QueueReleaseOptions }) => Effect.Effect<ReadonlyArray<Hyperlink.Decoded<typeof queueEncodedEntry>>, QueueReleaseEncodingError, Requirements>Export pending entries in encoded/wire form for remote handoff (requires an itemSchema).
releaseEncoded: (input: {
readonly options?: QueueReleaseOptions
}
input: {
readonly options?: anyoptions?: import QueueReleaseOptionsQueueReleaseOptions;
}) => 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<
interface ReadonlyArray<T>ReadonlyArray<import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof const queueEncodedEntry: Schema.Struct<{
readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>;
readonly item: any;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>
const queueEncodedEntry: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>; readonly item: any; readonly entryId: Schema.String; readonly key: Schema.optional<Schema.String>; readonly priority: Schema.Literals<readonly ['high', 'nor…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ [x: string]: any; }, readonly []>) => Schema.Struct<{ readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>; readonly item: any; readonly entryId: Schema.String; readonly key: Schema.o…;
annotateKey: (annotations: Schema.Annotations.Key<{ [x: string]: any }>) => Schema.Struct<{ readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>; readonly item: any; readonly entryId: Schema.String; readonly key: Schema.optional<Schema.St…;
check: (checks_0: Check<{ [x: string]: any }>, ...checks: Array<Check<{ [x: string]: any }>>) => Schema.Struct<{ readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>; readonly item: any; readonly entryId: Schema.String; readonly key…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>; readonly item: any; readonly entryId: Schema.String; readonly key: Schema.optional<Schema.String>; readonly priority: Schema.Literals<rea…;
make: (input: { [x: string]: any }, options?: Schema.MakeOptions) => { [x: string]: any };
makeOption: (input: { [x: string]: any }, options?: Schema.MakeOptions) => Option.Option<{ [x: string]: any }>;
makeEffect: (input: { [x: string]: any }, options?: Schema.MakeOptions) => Effect.Effect<{ [x: string]: any }, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
A queue entry in encoded / wire form — the element returned by releaseEncoded. The
item is replaced by its codec descriptor and the value lives in payload (already
JSON-encoded), so an encoded entry crosses RPC without the receiver knowing the item schema.
Mirrors the engine's QueueEncodedEntry.
queueEncodedEntry>>,
import QueueReleaseEncodingErrorQueueReleaseEncodingError,
function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements
>;
/** Remove pending entries matching the selector and route them to a dead letter. */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.deadLetter: (input: {
readonly selector: QueueEntrySelector<Payload> | QueueEntry<Payload>;
readonly options: QueueRouteOptions;
}) => Effect.Effect<ReadonlyArray<QueueEntry<Payload>>, never, Requirements>
Remove pending entries matching the selector and route them to a dead letter.
deadLetter: (input: {
readonly selector:
| QueueEntrySelector<Payload>
| QueueEntry<Payload>
readonly options: QueueRouteOptions
}
input: {
readonly selector: anyselector: import QueueEntrySelectorQueueEntrySelector<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload> | import QueueEntryQueueEntry<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload>;
readonly options: QueueRouteOptionsoptions: import QueueRouteOptionsQueueRouteOptions;
}) => 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<interface ReadonlyArray<T>ReadonlyArray<import QueueEntryQueueEntry<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload>>, never, function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements>;
/** Remove pending entries matching the selector without preserving them. */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.drop: (input: {
readonly selector: QueueEntrySelector<Payload> | QueueEntry<Payload>;
readonly options: QueueRouteOptions;
}) => Effect.Effect<ReadonlyArray<QueueEntry<Payload>>, never, Requirements>
Remove pending entries matching the selector without preserving them.
drop: (input: {
readonly selector:
| QueueEntrySelector<Payload>
| QueueEntry<Payload>
readonly options: QueueRouteOptions
}
input: {
readonly selector: anyselector: import QueueEntrySelectorQueueEntrySelector<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload> | import QueueEntryQueueEntry<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload>;
readonly options: QueueRouteOptionsoptions: import QueueRouteOptionsQueueRouteOptions;
}) => 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<interface ReadonlyArray<T>ReadonlyArray<import QueueEntryQueueEntry<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload>>, never, function (type parameter) Requirements in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Requirements>;
/** Discrete entry / worker / queue lifecycle events. */
readonly QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.events: Stream.Stream<QueueEvent<Payload, Error, Success>, never, never>(property) QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>.events: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Discrete entry / worker / queue lifecycle events.
events: import StreamStream.interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<import QueueEventQueueEvent<function (type parameter) Payload in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Payload, function (type parameter) Error in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Error, function (type parameter) Success in QueueHyperlink<Payload, Success = void, Error = never, Requirements = never>Success>>;
}