I’m using BackgrounDRb and according to the API I should be able to use
methods such as delete_worker() and send_request(). However when I try
to invoke these methods on my workers I get undefined method errors:
NoMethodError: undefined method `ask_work’ for
#BackgrounDRb::ClusterConnection:0xb7460304
I’m simply using the basic backgroundrb.yml for my configuration
Code : - fold - unfold
-
- :backgroundrb:
- :ip: 0.0.0.0
- :port: 11008
Would anybody know why I’m getting these errors?
On Wed, Jul 16, 2008 at 2:57 PM, Michelle Li
[email protected] wrote:
I’m using BackgrounDRb and according to the API I should be able to use
methods such as delete_worker() and send_request(). However when I try
to invoke these methods on my workers I get undefined method errors:
NoMethodError: undefined method `ask_work’ for
#BackgrounDRb::ClusterConnection:0xb7460304
I am terribly sorry for this, but bdrb client API has changed slightly
and in fact, its always best idea to refer official docs at:
http://backgroundrb.rubyforge.org
and RDoc manual thats linked there, as I mentioned in my previous
mail. Blog posts(including mine) and screencasts sometimes go out of
date with programming libraries.
In word, ask_work is no longer exposed to rails and if you want to
invoke a method, you will have to use:
#for async calls
MiddleMan.worker(:foo_worker).async_some_task(:arg => “foobar”)
for blocking/sync calls
MiddleMan.worker(:foo_worker).some_task(:arg => “foobar”)