PriorityLayerConfig<A, E, R, RR>Worker/layer config for a toolkit priority queue (tag carries itemSchema).
export type type PriorityLayerConfig<
A,
E,
R,
RR = never
> = Omit<
WorkPoolPriorityConfigWithItemSchema<A, E, R>,
"name" | "itemSchema" | "refill"
> & {
readonly refill?: {
readonly onStart?: boolean
readonly onDrained?: boolean
readonly load: (
queue: WorkPoolPriorityHandle<
A,
E,
QueueEnqueueErrors,
never
>
) => Effect.Effect<void, never, RR>
}
}
Worker/layer config for a toolkit priority queue (tag carries itemSchema).
PriorityLayerConfig<function (type parameter) A in type PriorityLayerConfig<A, E, R, RR = never>A, function (type parameter) E in type PriorityLayerConfig<A, E, R, RR = never>E, function (type parameter) R in type PriorityLayerConfig<A, E, R, RR = never>R, function (type parameter) RR in type PriorityLayerConfig<A, E, R, RR = never>RR = never> = type Omit<T, K extends keyof any> = {
[P in Exclude<keyof T, K>]: T[P]
}
Construct a type with the properties of T except for those in type K.
Omit<
type WorkPoolPriorityConfigWithItemSchema<T, E, R> = Omit<WorkPoolConfigBase<T>, "laneCount"> & WorkPoolPriorityLaneConfig & {
readonly itemSchema: Schema.Codec<T, unknown, never, never>;
readonly effect: (item: T, ctx: EffectContext<T, QueueEnqueueErrors, R>) => Effect.Effect<void, E, R>;
readonly onFailure?: QueueOnFailure<T, E, R>;
readonly refill?: WorkPoolPriorityRefill<T, E, QueueEnqueueErrors, R>;
readonly store?: QueueStoreWriter<T, E, void>;
}
WorkPoolPriorityConfigWithItemSchema<function (type parameter) A in type PriorityLayerConfig<A, E, R, RR = never>A, function (type parameter) E in type PriorityLayerConfig<A, E, R, RR = never>E, function (type parameter) R in type PriorityLayerConfig<A, E, R, RR = never>R>,
"itemSchema" | "refill" | "name"
> & {
readonly refill?: {
readonly onStart?: boolean
readonly onDrained?: boolean
readonly load: (
queue: WorkPoolPriorityHandle<
A,
E,
QueueEnqueueErrors,
never
>
) => Effect.Effect<void, never, RR>
}
refill?: {
readonly onStart?: boolean | undefinedonStart?: boolean;
readonly onDrained?: boolean | undefinedonDrained?: boolean;
readonly load: (
queue: WorkPoolPriorityHandle<
A,
E,
QueueEnqueueErrors,
never
>
) => Effect.Effect<void, never, RR>
load: (
queue: WorkPoolPriorityHandle<
A,
E,
QueueEnqueueErrors,
never
>
queue: type WorkPoolPriorityHandle<T, E = never, EEnqueue = never, R = never> = WorkPoolPriorityHandleApi<T, E, EEnqueue, R> & QueueHandlePhantomWorkerFailures<E>WorkPoolPriorityHandle<function (type parameter) A in type PriorityLayerConfig<A, E, R, RR = never>A, function (type parameter) E in type PriorityLayerConfig<A, E, R, RR = never>E, type QueueEnqueueErrors = QueueItemValidationError | QueueBatchValidationErrorEnqueue validation errors when
WorkPoolConfigWithItemSchema.itemSchema
is set.
QueueEnqueueErrors, never>,
) => 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) RR in type PriorityLayerConfig<A, E, R, RR = never>RR>;
};
};