Noodles Practicing Medicine

    sails-hook-resque

    1.1.2 • Public • Published

    sails-hook-resque

    Build Status

    Delayed tasks in Sails.js app. Using node-resque

    Configuration

    All configuration options are available in lib/defaults.js

    Queue usage

    Hook setup queue service in your Sails.js application

    Your Sails.js application will contain sails.resque.queue object that is NR.queue and have all it's methods.

    Usage in application In your application:

    Create a task in api/jobs/add.js :

    module.exports = {
        plugins: [ 'jobLock' ],
        pluginOptions: {
          jobLock: {},
        },
        perform: function(a, b, callback){
          setTimeout(function(){
            var answer = a + b;
            callback(null, answer);
          }, 1000);
        },
      };

    And queue it in your application:

    sails.resque.queue.enqueue('math', 'add', [1, 2]);

    Install

    npm i sails-hook-resque

    DownloadsWeekly Downloads

    12

    Version

    1.1.2

    License

    MIT

    Last publish

    Collaborators

    • kos