DurableQueue
Constructors
Signature
declare function make< Payload extends any, Success extends Any = Void, Error extends All = Never,>(options: { readonly error?: Error; readonly idempotencyKey: ( payload: Payload extends Fields ? View<Payload, "Type", TypeOptionalKeys<Payload>, TypeMutableKeys<Payload>> : Payload["Type"], ) => string; readonly name: string; readonly payload: Payload; readonly success?: Success;}): DurableQueue<Payload extends Fields ? Struct<Payload> : Payload, Success, Error>;Models
DurableQueue interface
Added in v1.0.0
Source
Signature
interface DurableQueue< Payload extends Schema.Schema.Any, Success extends Schema.Schema.Any = typeof Schema.Void, Error extends Schema.Schema.All = typeof Schema.Never,> { readonly "~@effect/workflow/DurableQueue": "~@effect/workflow/DurableQueue"; readonly deferred: DurableDeferred<Success, Error>; readonly idempotencyKey: (payload: Payload["Type"]) => string; readonly name: string; readonly payloadSchema: Payload;}Processing
Signature
declare const process: < Payload extends Schema.Schema.Any, Success extends Schema.Schema.Any, Error extends Schema.Schema.All,>( self: DurableQueue<Payload, Success, Error>, payload: Payload["Type"], options?: { readonly retrySchedule?: Schedule.Schedule<any, PersistedQueue.PersistedQueueError>; },) => Effect.Effect< Success["Type"], Error["Type"], | WorkflowEngine.WorkflowEngine | WorkflowEngine.WorkflowInstance | PersistedQueue.PersistedQueueFactory | Success["Context"] | Error["Context"] | Payload["Context"]>;Type IDs
Worker
makeWorker
Added in v1.0.0
Source
Signature
declare const makeWorker: < Payload extends Schema.Schema.Any, Success extends Schema.Schema.Any, Error extends Schema.Schema.All, R,>( self: DurableQueue<Payload, Success, Error>, f: (payload: Payload["Type"]) => Effect.Effect<Success["Type"], Error["Type"], R>, options?: { readonly concurrency?: number; },) => Effect.Effect< never, never, | WorkflowEngine.WorkflowEngine | PersistedQueue.PersistedQueueFactory | R | Payload["Context"] | Success["Context"] | Error["Context"]>;Signature
declare const worker: < Payload extends Schema.Schema.Any, Success extends Schema.Schema.Any, Error extends Schema.Schema.All, R,>( self: DurableQueue<Payload, Success, Error>, f: (payload: Payload["Type"]) => Effect.Effect<Success["Type"], Error["Type"], R>, options?: { readonly concurrency?: number; },) => Layer.Layer< never, never, | WorkflowEngine.WorkflowEngine | PersistedQueue.PersistedQueueFactory | R | Payload["Context"] | Success["Context"] | Error["Context"]>;
A
DurableQueuewraps aPersistedQueue, providing a way to wait for items to finish processing using aDurableDeferred.