How to use the node-resque.Scheduler 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 metricio / metricio / lib / scheduler.js View on Github external
export default () => {
  const scheduler = new NodeResque.Scheduler({
    connection: storage.resqueConfig,
  });

  scheduler.on('start', () => {
    logger('info', 'scheduler: started');
  });

  scheduler.on('end', () => {
    logger('info', 'scheduler: ended');
  });

  // scheduler.on('poll', () => {
  //   logger('info', 'scheduler: polling');
  // });

  scheduler.on('master', () => {
github StellarFw / stellar / src / satellites / resque.ts View on Github external
private async startScheduler(): Promise {
    if (this.api.configs.tasks.scheduler !== true) {
      return;
    }

    this.schedulerLogging = this.api.configs.tasks.schedulerLogging;

    this.scheduler = new NodeResque.Scheduler({
      connection: this.connectionDetails,
      timeout: this.api.configs.tasks.timeout,
    });

    this.scheduler.on("error", error =>
      this.api.log(error, LogLevel.Error, "[api.resque.scheduler]"),
    );

    await this.scheduler.connect();

    this.scheduler.on("start", () =>
      this.api.log("resque scheduler started", this.schedulerLogging.start),
    );
    this.scheduler.on("end", () =>
      this.api.log("resque scheduler ended", this.schedulerLogging.end),
    );

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