[Backgroundrb-devel] 1) Error 2) sending request to a specific worker

hemant gethemant at gmail.com
Mon Dec 17 04:15:32 EST 2007


On Dec 16, 2007 3:38 AM, Mickael Faivre-Macon <faivrem at gmail.com> wrote:
> Hello !
>
> 1) I have this error logged by bdrb:
> undefined method `send_request' for nil:NilClass
> framework/packet_master.rb:58:in `ask_worker'
> backgroundrb/server/master_worker.rb:59:in `process_work'
> backgroundrb/server/master_worker.rb:16:in `receive_data'
> backgroundrb/framework/bin_parser.rb:29:in `call'
> backgroundrb/framework/bin_parser.rb:29:in `extract'
> backgroundrb/server/master_worker.rb:12:in `receive_data'
> backgroundrb/framework/core.rb:191:in `read_external_socket'
> backgroundrb/framework/core.rb:183:in `handle_external_messages'
> backgroundrb/framework/core.rb:156:in `start_reactor'
> backgroundrb/framework/core.rb:152:in `each'
> backgroundrb/framework/core.rb:152:in `start_reactor'
> backgroundrb/framework/core.rb:144:in `loop'
> backgroundrb/framework/core.rb:144:in `start_reactor'
> backgroundrb/framework/packet_master.rb:20:in `run'
> backgroundrb/server/master_worker.rb:115:in `initialize'
> ./script/backgroundrb:39:in `new'
> ./script/backgroundrb:39
>
> my code is :
>
> class MyController < ApplicationController
>
>   def index
>   end
>
>   def login
>     @worker = MiddleMan.new_worker(:worker => :xmpp_worker, :job_key => :my_key)
>     MiddleMan.ask_work(:worker => :xmpp_worker, :worker_method =>
> :login, :data => "test")
>     render(:partial=>'window')
>   end
>
> end
>
> class XmppWorker < BackgrounDRb::MetaWorker
>   set_worker_name :xmpp_worker
>   set_no_auto_load true
>
>   def create(args = nil)
>   end
>
>   def login
>   end
>
> end
>
> Can someone helps me ?
>
> 2) I am creating a worker with a key : MiddleMan.new_worker(:worker =>
> :xmpp_worker, :job_key => :my_key)
> Is it possible to use this key in a request to send work to a specific worker ?
>

Hi Michale,

There was a genuine bug with backgroundrb in job_key handling. If you
don't want to use threads and would rather want to have processes, you
can try your code now.

It should be fixed and working.
-- 
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.

http://gnufied.org


More information about the Backgroundrb-devel mailing list