# BackgrounDRb undefined method

**URL:** <https://www.ruby-forum.com/t/backgroundrb-undefined-method/143206>\
**Category:** Rails\
**Created:** [July 16, 2008, 11:27am UTC](https://www.ruby-forum.com/t/backgroundrb-undefined-method/143206 "2008-07-16T11:27:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miss\_michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Post date:** [July 16, 2008, 11:27am UTC](https://www.ruby-forum.com/t/backgroundrb-undefined-method/143206/1 "2008-07-16T11:27:11Z")

</div>

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

1. 
* * *
2. :backgroundrb:
3. :ip: 0.0.0.0
4. :port: 11008

Would anybody know why I’m getting these errors?

---

<div class="post-metadata">

**Author:** ![miss\_michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Post date:** [July 16, 2008, 12:11pm UTC](https://www.ruby-forum.com/t/backgroundrb-undefined-method/143206/2 "2008-07-16T12:11:38Z")

</div>

On Wed, Jul 16, 2008 at 2:57 PM, Michelle Li  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](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”)
