刘昊
2008-Aug-10 10:22 UTC
[Backgroundrb-devel] How to keep from generating more than one worker?
Hi, guys, I only want one BackgrounDRB worker for my rails app except for the log_worker baked in. And how to assign a worker_key to a worker? All the best, Hao Liu -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080810/44e30dd0/attachment.html>
hemant
2008-Aug-10 10:30 UTC
[Backgroundrb-devel] How to keep from generating more than one worker?
On 8/10/08, ?? <leomayleomay at gmail.com> wrote:> Hi, guys, > I only want one BackgrounDRB worker for my rails app except for the > log_worker baked in.put :debug_log: false in your backgroundrb.yml file, like: :backgroundrb: :ip: 0.0.0.0 :port: 11006 :debug_log: false> And how to assign a worker_key to a worker?worker_key can be only assigned to workers that are created using MiddleMan.new_worker(:worker => :hello_worker,:worker_key => "boy") -- 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
hemant
2008-Aug-10 11:10 UTC
[Backgroundrb-devel] How to keep from generating more than one worker?
On 8/10/08, ?? <leomayleomay at gmail.com> wrote:> > > Thank you for your reply.Please, keep the converation on the mailing list. Lots of folks, try to search archives for similar questions and hence could be useful to them.> > I tried to create a new worker and assign a worker key to it, following is > what I did in ./script/console: > > >> MiddleMan.new_worker(:worker => :hello_worker,:worker_key => "boy") > => nil > >> MiddleMan.worker(:hello_worker).worker_info > => {:status=>:stopped, :worker=>:hello_worker, :worker_key=>nil}When, you say: MiddleMan.worker(:hello_worker).worker_info you are asking worker_info for worker "hello_worker" which is running without any worker_key and hence result is expected. Try: MiddleMan.all_worker_info -- 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
刘昊
2008-Aug-10 13:31 UTC
[Backgroundrb-devel] How to keep from generating more than one worker?
2008/8/10 hemant <gethemant at gmail.com>> On 8/10/08, ?? <leomayleomay at gmail.com> wrote: > > > > > > Thank you for your reply. > > Please, keep the converation on the mailing list. Lots of folks, try > to search archives for similar questions and hence could be useful to > them. > > > > > I tried to create a new worker and assign a worker key to it, following > is > > what I did in ./script/console: > > > > >> MiddleMan.new_worker(:worker => :hello_worker,:worker_key => "boy") > > => nil > > >> MiddleMan.worker(:hello_worker).worker_info > > => {:status=>:stopped, :worker=>:hello_worker, :worker_key=>nil} > > When, you say: > MiddleMan.worker(:hello_worker).worker_info > > you are asking worker_info for worker "hello_worker" which is running > without any worker_key and hence result is expected. Try: > > MiddleMan.all_worker_info > > > > > > -- > 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 >oops, sorry, I wrongly chose ''Reply'' but ''Reply all''. Two things: 1. How come "hello_worker" doesn''t have a worker_key? I assigned "boy" as its worker_key. 2. Can I use worker_key to identify the sole worker in my rails app? say, can I use the following code to keep only one worker working in my app? unless MiddleMan.worker(:alert_worker, :alerter) MiddleMan.new_worker(:worker => :alert_worker, :worker_key => :alerter) end Thank you, All the best, Hao Liu -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080810/dff25f4e/attachment.html>