How to use the node-resque.Plugin 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 actionhero / actionhero / initializers / tasks.js View on Github external
const processMiddleware = (m) => {
        if (api.tasks.middleware[m]) {
          class Plugin extends NodeResque.Plugin {}
          if (api.tasks.middleware[m].preProcessor) { Plugin.prototype.beforePerform = api.tasks.middleware[m].preProcessor }
          if (api.tasks.middleware[m].postProcessor) { Plugin.prototype.afterPerform = api.tasks.middleware[m].postProcessor }
          if (api.tasks.middleware[m].preEnqueue) { Plugin.prototype.beforeEnqueue = api.tasks.middleware[m].preEnqueue }
          if (api.tasks.middleware[m].postEnqueue) { Plugin.prototype.afterEnqueue = api.tasks.middleware[m].postEnqueue }
          plugins.push(Plugin)
        }
      }

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