@flow-state-dev/bullmq/job-processor
Interfaces
CreateJobProcessorOptions
Extends
Properties
connection
connection: string | RedisOptions;
ioredis connection (URL string or options object).
Inherited from
BullmqConnectionOptions.connection
deps
deps: JobProcessorDeps;
prefix?
prefix?: string;
BullMQ key prefix for multi-tenant namespacing. Default "fsd".
Inherited from
BullmqConnectionOptions.prefix
queueName?
queueName?: string;
retry?
retry?: RetryConfig;
JobProcessorDeps
Dependencies injected into the job processor.
Properties
bridge?
bridge?: StreamBridge;
concurrency?
concurrency?: number;
deferPatienceMs?
deferPatienceMs?: number;
How long a defer job yields to hold runs that start after it began
waiting, before it lines up behind the runs on its key. Default: the
engine's DEFER_PATIENCE_MS (30 seconds), which its arbiter also waits
with, so a deferred run waits the same on a worker as in process.
leaseBackend?
leaseBackend?: JobLeaseBackend;
The lease backend the deployment's concurrency places live on. A job that carries a place waits for its turn on it. Absent → a job runs as soon as a worker takes it, place or not.
lockDuration?
lockDuration?: number;
onItem?
onItem?: (jobId, item, kind) => void;
Parameters
jobId
string
item
OutputItem
kind
"added" | "updated" | "done"
Returns
void
registry
registry: FlowRegistry;
resolvePrincipal?
resolvePrincipal?: ResolvePrincipalFn;
The host-level principal resolver this deployment's web host is given
(createFlowState({ resolvePrincipal })). The default write flow decides
whether two flows that declare one resource agree with it, as the host's
route does, so pass the same one. Default: the development resolver, as the
host's own default.
runtimeConfig
runtimeConfig: RuntimeConfig;
stores
stores: StoreRegistry;
Functions
createFlowJobProcessor()
function createFlowJobProcessor(deps): (job, token?) => Promise<ExecutionResult<unknown> | undefined>;
Builds the per-job function createJobProcessor hands BullMQ. Exported separately so
the retry/terminal-publish semantics are testable without a Redis
connection (constructing a BullMQ Worker connects eagerly).
Parameters
deps
Returns
(job, token?) => Promise<ExecutionResult<unknown> | undefined>
createJobProcessor()
function createJobProcessor(options): Worker;
Creates a BullMQ Worker that processes flow-run jobs by calling runAction.
Each job carries a FlowJobData payload; the worker resolves the flow from
the registry, executes it, and maps the result back to BullMQ job
completion/failure semantics.
Parameters
options
Returns
Worker