property QueuePluginOptions.processors
Since 0.3.0

Processors registered declaratively, as an alternative to calling queue.process(name, processor, options) imperatively after start(). Each entry — instance or RegistryFactory — produces one process() call, so a processor can be declared where the plugin is composed instead of after the application has started.

Instance entries register during the plugin's register() phase, identical to the imperative timing. The one exception is an array that also carries a FACTORY: the whole array then registers in onInit, in DECLARED order, because process() is last-wins on a job name and registering instances first would let a leading factory beat a trailing instance. Factory entries are resolved in the onInit phase — the first at which the registry holds every capability — so a factory can build its processor from a resolved capability. A factory that throws rejects start() with an error naming QueuePlugin({ processors }) and the entry's index in THIS declared array, not its position among the factories.

Registering two entries under one job name keeps the service's existing last-wins behaviour: exactly what two imperative process() calls with the same name do — decided by DECLARED order, so a trailing entry beats a leading one whichever arm each uses.

Type

Usage

import { type QueuePluginOptions } from "queue-plugin/src/index.ts";