Skip to content

officeluv/resque-enqueue-activejob

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

resque-enqueue-activejob

Build status

Enqueues tasks to resque 1.x.x, specifically for the ActiveJob wrapper. Does not attempt to do anything else. redis should be something like node-redis that has sadd and rpush with a callback API.

Based on the original package for bare resque: resque-enqueue.

var enqueue = require('resque-enqueue-activejob');

enqueue(redis, 'normal', 'SendWelcome', 'bob@bob.com', function(err) {
  if(!err) {
    console.log("mail sent!");
  }
});

API

Enqueue

enqueue(redis, queue, className, args..., cb)
// or
enqueue.enqueue(redis, queue, className, args..., cb)

Enqueues a single task to resque.

Set Namespace

enqueue.setNamespace(namespace)

Sets the namespace, defaults to resque.