How to use the node-resque.MultiWorker function in node-resque

To help you get started, we’ve selected a few node-resque examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github StellarFw / stellar / src / satellites / resque.ts View on Github external
public async startMultiworker(): Promise {
    const workerLogging = this.api.configs.tasks.workerLogging;
    const schedulerLogging = this.api.configs.tasks.schedulerLogging;

    // create a new multiworker instance
    this.multiWorker = new NodeResque.MultiWorker(
      {
        connection: this.connectionDetails,
        queues: this.api.configs.tasks.queues,
        timeout: this.api.configs.tasks.timeout,
        checkTimeout: this.api.configs.tasks.checkTimeout,
        minTaskProcessors: this.api.configs.tasks.minTaskProcessors,
        maxTaskProcessors: this.api.configs.tasks.maxTaskProcessors,
        maxEventLoopDelay: this.api.configs.tasks.maxEventLoopDelay,
        toDisconnectProcessors: this.api.configs.tasks.toDisconnectProcessors,
      },
      this.api.tasks.jobs,
    );

    // normal worker emitters
    this.multiWorker.on("start", workerId =>
      this.api.log("worker: started", workerLogging.start, {

node-resque

an opinionated implementation of resque in node

Apache-2.0
Latest version published 5 months ago

Package Health Score

78 / 100
Full package analysis