QueueHyperlinkConfigWithoutItemSchema<T, E, R>Queue configuration without QueueHyperlinkConfigBase item schema. Enqueue helpers on QueueHandle and the EffectContext do not fail with schema validation errors.
export type type QueueHyperlinkConfigWithoutItemSchema<
T,
E,
R
> = QueueHyperlinkConfigBase<T> & {
readonly itemSchema?: undefined
readonly effect: (
item: T,
ctx: EffectContext<T, never, R>
) => Effect.Effect<void, E, R>
readonly onFailure?: QueueOnFailure<T, E, R>
readonly refill?: QueueRefill<T, E, never, R>
}
Queue configuration without
QueueHyperlinkConfigBase
item schema.
Enqueue helpers on
QueueHandle
and the
EffectContext
do not fail with
schema validation errors.
QueueHyperlinkConfigWithoutItemSchema<function (type parameter) T in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>T, function (type parameter) E in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>E, function (type parameter) R in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>R> = interface QueueHyperlinkConfigBase<T>Shared queue configuration fields (see
QueueHyperlinkConfig
).
QueueHyperlinkConfigBase<function (type parameter) T in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>T> & {
readonly itemSchema?: undefineditemSchema?: undefined;
/**
* Process each item. Receives a guarded {@link EffectContext} for spawning
* derived work. The exit of this effect determines success/failure for the item;
* the success channel is always **`void`**.
*/
readonly effect: (
item: T,
ctx: EffectContext<T, never, R>
) => Effect.Effect<void, E, R>
Process each item. Receives a guarded
EffectContext
for spawning
derived work. The exit of this effect determines success/failure for the item;
the success channel is always void.
effect: (item: Titem: function (type parameter) T in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>T, ctx: EffectContext<T, never, R>(parameter) ctx: {
add: QueueEnqueue<T, EEnqueue, R>;
prioritize: QueueEnqueue<T, EEnqueue, R>;
defer: QueueEnqueue<T, EEnqueue, R>;
attempts: number;
enqueuedAt: number;
priority: Priority;
}
ctx: interface EffectContext<T, EEnqueue = never, R = never>Context passed to the effect callback during item processing.
Provides guarded enqueue operations for spawning derived/follow-up work.
Attempting to enqueue the same item (by reference or by key) logs a warning
and silently drops the item to prevent infinite processing loops.
For intentional re-processing, fail the worker effect (auto re-enqueue applies up to
QueueHyperlinkConfigBase.attempts
) or re-inject via queue.enqueue off the events stream.
EffectContext<function (type parameter) T in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>T, never, function (type parameter) R in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>R>) => 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, function (type parameter) E in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>E, function (type parameter) R in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>R>;
/** Optional inline per-error disposition. See {@link QueueOnFailure}. */
readonly onFailure?: QueueOnFailure<T, E, R>Optional inline per-error disposition. See
QueueOnFailure
.
onFailure?: interface QueueOnFailure<T, E, R>Optional inline failure hook — the one legitimate control callback (a stream is after-the-fact
and can't decide disposition). Runs in the worker R on each failed item, returning a
QueueFailureDisposition
. Observation still belongs on the events stream; this is
control.
QueueOnFailure<function (type parameter) T in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>T, function (type parameter) E in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>E, function (type parameter) R in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>R>;
/** Optional self-refill from a source on start / drain. See {@link QueueRefill}. */
readonly refill?: | QueueRefill<T, E, never, R, void>
| undefined
Optional self-refill from a source on start / drain. See
QueueRefill
.
refill?: interface QueueRefill<T, E, EEnqueue, R, A = void>Self-refill — load work into the queue from a source (DB, …) on start and/or whenever it
drains empty (a self-feeding queue). load receives the queue handle and runs in the worker R,
best-effort (failures are logged, not fatal). This is the toolkit equivalent of the legacy
onStart / onDrained lifecycle hooks — a defining queue behavior (a pull source), distinct
from after-the-fact observation on the events stream.
QueueRefill<function (type parameter) T in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>T, function (type parameter) E in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>E, never, function (type parameter) R in type QueueHyperlinkConfigWithoutItemSchema<T, E, R>R>;
};