Skip to content

basalt / queue-bullmq/src / bullmqQueuePlugin

Function: bullmqQueuePlugin() ​

> bullmqQueuePlugin(options): BasaltPlugin<unknown>

Defined in: queue-bullmq/src/index.ts:278

The BullMQ-backed queue plugin — jobs on Redis in one line:

ts
bullmqQueuePlugin({
  connection: process.env.REDIS_URL!,
  jobs: [SendWelcome],
  workers: [{ queue: 'welcome', concurrency: 5 }],
})

Each backend ships its own plugin of this shape (rabbitmqQueuePlugin, sqsQueuePlugin, kafkaQueuePlugin), so no backend is privileged in the core's API and @basaltkit/queue stays a pure contract. Use queuePlugin({ driver }) directly for a driver you wrote yourself.

The driver is built here, when the app is DEFINED, which is safe because the constructor performs no I/O: it parses the connection string and stores the handlers, while the underlying Queue/Worker objects — and therefore every Redis socket — are created lazily on first use. The one visible consequence is welcome: a malformed connection string throws at definition time instead of at the first dispatch.

Parameters ​

options ​

BullmqQueuePluginOptions

Returns ​

BasaltPlugin<unknown>

Released under the MIT License.