BullModule

  
class BullModule {
  static queueClass: Type
  static flowProducerClass: Type
  static workerClass: Type
  static forRoot(keyOrConfig: any, bullConfig?: QueueOptions): DynamicModule
  static forRootAsync(keyOrAsyncConfig: string | SharedBullAsyncConfiguration, asyncBullConfig?: SharedBullAsyncConfiguration): DynamicModule
  static registerQueue(...options: RegisterQueueOptions[]): DynamicModule
  static registerQueueAsync(...options: RegisterQueueAsyncOptions[]): DynamicModule
  static registerFlowProducer(...options: RegisterFlowProducerOptions[]): DynamicModule
  static registerFlowProducerAsync(...options: RegisterFlowProducerAsyncOptions[]): DynamicModule
}

Static properties

Property Description
static queueClass: Type Write-only.

Class to be used to create Bull queues. This configuration property can be used to instruct the "@nestjs/bullmq" package to use, for example, "QueuePro" class (from "BullMQ Pro"). By default is Queue

static flowProducerClass: Type Write-only.

Class to be used to create Bull flow producers. This configuration property can be used to instruct the "@nestjs/bullmq" package to use, for example, "FlowProducerPro" class (from "BullMQ Pro"). By default is FlowProducer

static workerClass: Type Write-only.

Class to be used to create Bull workers. This configuration property can be used to instruct the "@nestjs/bullmq" package to use, for example, "WorkerPro" class (from "BullMQ Pro"). By default is Worker

Static methods

forRoot()

Registers a globally available configuration for all queues or using a specified "configKey" (if passed).

Registers a globally available configuration for all queues.


static forRoot(bullConfig: QueueOptions): DynamicModule

Parameters

Option Type Description
bullConfig QueueOptions

shared bull configuration object

Returns

DynamicModule

Registers a globally available configuration under a specified "configKey".


static forRoot(configKey: string, bullConfig: QueueOptions): DynamicModule

Parameters

Option Type Description
configKey string

a key under which the configuration should be available

bullConfig QueueOptions

Returns

DynamicModule

forRootAsync()

Registers a globally available configuration for all queues or using a specified "configKey" (if passed).

Registers a globally available configuration for all queues.


static forRootAsync(asyncBullConfig: SharedBullAsyncConfiguration): DynamicModule

Parameters

Option Type Description
asyncBullConfig SharedBullAsyncConfiguration

shared bull configuration async factory

Returns

DynamicModule

Registers a globally available configuration under a specified "configKey".


static forRootAsync(configKey: string, asyncBullConfig: SharedBullAsyncConfiguration): DynamicModule

Parameters

Option Type Description
configKey string

a key under which the configuration should be available

asyncBullConfig SharedBullAsyncConfiguration

shared bull configuration async factory

Returns

DynamicModule

registerQueue()


static registerQueue(...options: RegisterQueueOptions[]): DynamicModule

Parameters

Option Type Description
options RegisterQueueOptions[]

Returns

DynamicModule

registerQueueAsync()


static registerQueueAsync(...options: RegisterQueueAsyncOptions[]): DynamicModule

Parameters

Option Type Description
options RegisterQueueAsyncOptions[]

Returns

DynamicModule

registerFlowProducer()


static registerFlowProducer(...options: RegisterFlowProducerOptions[]): DynamicModule

Parameters

Option Type Description
options RegisterFlowProducerOptions[]

Returns

DynamicModule

registerFlowProducerAsync()


static registerFlowProducerAsync(...options: RegisterFlowProducerAsyncOptions[]): DynamicModule

Parameters

Option Type Description
options RegisterFlowProducerAsyncOptions[]

Returns

DynamicModule