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

Mickael Faivre-Macon faivrem at gmail.com
Sat Dec 15 17:08:55 EST 2007


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 ?

Thanks for your help,
Mickael.


More information about the Backgroundrb-devel mailing list