No commit activity in last 3 years
No release in over 3 years
Remotely enqueueing and dequeueing jobs across Redis namespaces should be simpler. BJ Neilsen laid a solid foundation for this gem, which is forked off of his gem resque-remote. That said, these two gems provide a different set of methods for remote enqueueing and dequeueing. If all you need is remote enqueueing within the same namespace, use resque-remote.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 2.8

Runtime

 Project Readme

resque-remote-namespace is a fork of the remote-namespace gem that allows for remote enqueueing and dequeueing of jobs on different redis namespaces.

Installation

Add it to your Bundler Gemfile:

# Gemfile
gem 'resque-remote-namespace'

And then run bundle install.

Usage

Enqueueing

# Enqueues TestJob to the "default" queue on the "resque:foo" redis namespace with "foo" as its sole argument.
Resque.remote_enqueue_to 'default', 'resque:foo', 'TestJob', 'foo'

# Enqueues TestJob to the "default" queue on the "resque:foo" redis namespace in 5 minutes with "foo" as its sole argument. (Uses resque-scheduler gem)
Resque.remote_enqueue_to_in 5.minutes, 'default', 'resque:foo', 'TestJob', 'foo'

Dequeueing

# Dequeues TestJob from the "default" queue on the "resque:foo" redis namespace with "foo" as its sole argument
Resque.remote_dequeue_from 'default', 'resque:foo', 'TestJob', 'foo'

Worker Processing

The job you are remotely enqueueing does not need to exist in the application you are in enqueueing it from, however if Resque.inline is set to true (as is often the case in a development or test environment) then Resque may attempt to execute the job in the current application, depending on which version of Resque you are using. This will cause a NameError to be raised.

To fix this, just create a stub of the job you are remote enqueueing. Ex:

# Stub of TestJob. Actual implementation is located in X.
class TestJob
  def self.perform(*args) end
end

Note that the actual implementation of the remote job does not need to have its @queue defined.

class TestJob
  # no queue needed

  def self.perform(*args)
    ...
  end
end