2013-03-08 93 views
0

所以我有两台服务器。Resque远程作业

服务器A:有Redis的,红宝石+ resque宝石+耙宝石 服务器B:有Ruby on Rails的+ resque宝石

从服务器BI排队作业到Redis的服务器A服务器A接收到作业:

*** Found job on test 
*** got: (Job{test} | TestQueue | []) 
*** Running before_fork hooks with [(Job{test} | TestQueue | [])] 
*** resque-1.23.1: Forked 10388 at 1362750385 
*** Failed to start worker : #<NameError: uninitialized constant TestQueue> 

所以我想通了工作需要住在服务器A于是我搬到作业那里。但是,当我从服务器B上排队,我得到如下:

rails console 
Loading development environment (Rails 3.2.12) 
irb(main):001:0> Resque.enqueue(TestQueue) 
NameError: uninitialized constant TestQueue 

的唯一方法我没有得到它的工作时,我曾在两个服务器的工作,但理想那远。

如何远程排队排队作业?

+0

哪里TestQueue类服务器A和服务器B – Viren 2013-03-08 17:24:42

回答

0

resque-remote是用于远程排队工作的gem。

如果Resque.inline为true,则该作业将排入当前队列。

来源:https://github.com/localshred/resque-remote

+0

定义为任何人读这篇文章,如果您正在使用Resque的新版本,即> = 2.x中,你不需要这个宝石。只需使用标准API方法Resque.push即可。 http://rubydoc.info/github/resque/resque/Resque:push – Andres 2014-05-22 20:53:08