Wolfgang Borgon
2006-Sep-08 19:22 UTC
[Backgroundrb-devel] Access worker outside of Rails?
Hi all, Wondering if it''s possible to access a worker from outside of Rails -- I''ve tried simply including: require RAILS_ROOT + ''/vendor/plugins/backgroundrb/backgroundrb.rb'' BackgrounDRb.MiddleMan.get_worker(key) but, I get an error that the ''get_worker'' method is undefined. Any ideas? Thanks a lot, W -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060908/2d4dc172/attachment.html
Ezra Zygmuntowicz
2006-Sep-08 21:24 UTC
[Backgroundrb-devel] Access worker outside of Rails?
On Sep 8, 2006, at 12:22 PM, Wolfgang Borgon wrote:> Hi all, > Wondering if it''s possible to access a worker from outside of Rails > -- I''ve tried simply including: > > require RAILS_ROOT + ''/vendor/plugins/backgroundrb/backgroundrb.rb'' > BackgrounDRb.MiddleMan.get_worker (key) > > but, I get an error that the ''get_worker'' method is undefined. Any > ideas? > Thanks a lot, > WTo use it from outside of rails you need to start up a drb client in your script. So soemthing like this: #!/usr/bin/env ruby require "drb" DRb.start_service MiddleMan = DRbObject.new(nil, "druby://localhost:22222") MiddleMan.get_worker(:somekey) Cheers- -Ezra