[Backgroundrb-devel] undefined method `[]' for #<BackgrounDRb::ClusterConnection:0x24a0a04>

Ryan Harnwell rh at unlocktechnology.com.au
Wed Nov 25 00:02:37 EST 2009


Hi all,

I am new to this mailing-list, hello everyone!

I am receiving an error in rails ever since implementing BackgrounDRb.

Please let me know if any information is missing and any help is greatly
appreciated!!!

Here is the code snippet:

#application_controller.rb
unless MiddleMan[:alerter] MiddleMan.new_worker(:class =>
:alert_worker,:job_key => :alerter) end # alert_worker.rb require 'XMPP4R'
'XMPP4R'
class AlertWorker < BackgrounDRb::Worker::RailsBase
  set_worker_name :alert_worker

  def do_work(args)
    jid = Jabber::JID.new("username at gmail.com")
#    @client = Jabber::Client.new(jid, false)
   @client = Jabber::Client.new(jid)
    @client.connect
    @client.auth("password")

 @client.send(Jabber::Presence.new.set_show(:chat).set_status('BackgrounDRb!'))
    loop do
      @client.process
      sleep(1)
    end
  end

  def send_alert(title)
    to_jid = Jabber::JID.new('username at gmail.com')
    message = Jabber::Message::new(to_jid,
title).set_type(:normal).set_id('1')
    @client.send(message)
  end

end
AlertWorker.register

# my controller

  after_create :send_message

  def send_message
    MiddleMan.worker(:alerter).send_alert("hello")
  end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20091125/34c20d54/attachment.html>


More information about the Backgroundrb-devel mailing list