Hi the list people, hi Ezra, I just read from this message http://rubyforge.org/pipermail/backgroundrb-devel/2006-July/000134.html that BackgrounDRb will offer a way to kill a worker from within itself. As this message is from 7/25, I wonder if this feature has been added since. If not, is there any way to do it? I tried this: MiddleMan.delete_worker(@_job_key) But it raise: uninitialized constant MiddleMan - (NameError) Thanks Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060901/c4e742a6/attachment.html
On Sep 1, 2006, at 8:00 AM, Jonathan M?tillon wrote:> Hi the list people, hi Ezra, > > I just read from this message http://rubyforge.org/pipermail/ > backgroundrb-devel/2006-July/000134.html that BackgrounDRb will > offer a way to kill a worker from within itself. > > As this message is from 7/25, I wonder if this feature has been > added since. If not, is there any way to do it? I tried this: > > MiddleMan.delete_worker (@_job_key) > > But it raise: > > uninitialized constant MiddleMan - (NameError) > > Thanks > > Jonathan > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-develJonathan- If your worker is done and not doing any more computation you can just call kill from within your worker. If it is still working on something and you need its thread to be killed also you can do like this: ::BackgrounDRb::MiddleMan.instance.delete_worker @_job_key -Ezra -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060901/b0f472a5/attachment.html
Thanks Ezra that works very well! Can you tell me what means the :: at the start of the line? On 9/1/06, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:> > > On Sep 1, 2006, at 8:00 AM, Jonathan M?tillon wrote: > > Hi the list people, hi Ezra, > > I just read from this message > http://rubyforge.org/pipermail/backgroundrb-devel/2006-July/000134.htmlthat BackgrounDRb will offer a way to kill a worker from within itself. > > As this message is from 7/25, I wonder if this feature has been added > since. If not, is there any way to do it? I tried this: > > MiddleMan.delete_worker (@_job_key) > > But it raise: > > uninitialized constant MiddleMan - (NameError) > > Thanks > > Jonathan > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > Jonathan- > > If your worker is done and not doing any more computation you can just > call kill from within your worker. If it is still working on something and > you need its thread to be killed also you can do like this: > > ::BackgrounDRb::MiddleMan.instance.delete_worker @_job_key > > -Ezra >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060906/a17720fd/attachment.html
I wonder why Ezra proposed the delete_worker method if a kill method exists? Maybe it''s a brand new feature? i was not aware of it and found nothing about this while googling. On 9/6/06, Chris Roos <chrisjroos at gmail.com> wrote:> > There is also a kill method for a worker, so I believe (and it seems > to work) that you can just use kill (or self.kill) in place of the > above chain. > > The :: references the top level namespace. > > Chris > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060906/a9f2f90d/attachment.html
the :: means, start the class/module lookup at the root, so as not to conflict with any class/module namespaces you might already have. If you have a class you''ve defined called, say Violin, and it has a module or maybe a subclass called String (since violins have strings, get it?), then, if you wanted to create an actual String to deal with letters, you''d have to create it like so: ::String.new("A") because just saying: String.new("A") would find your Violin::String before it found the real String class. it''s like in xpath, putting the // will return you to the root of the doc to perform lookups. If you''re interested, the Ruby for Rails book has more on this (and uses the same example that I blantantly stole). On 9/6/06, Jonathan M?tillon <jmetillon at gmail.com> wrote:> Thanks Ezra that works very well! > > Can you tell me what means the :: at the start of the line? > > > On 9/1/06, Ezra Zygmuntowicz < ezmobius at gmail.com> wrote: > > > > > > > > > > > > > > On Sep 1, 2006, at 8:00 AM, Jonathan M?tillon wrote: > > > > > > > > Hi the list people, hi Ezra, > > > > I just read from this message > http://rubyforge.org/pipermail/backgroundrb-devel/2006-July/000134.html > that BackgrounDRb will offer a way to kill a worker from within itself. > > > > As this message is from 7/25, I wonder if this feature has been added > since. If not, is there any way to do it? I tried this: > > > > MiddleMan.delete_worker (@_job_key) > > > > But it raise: > > > > uninitialized constant MiddleMan - (NameError) > > > > Thanks > > > > Jonathan > > > > > > _______________________________________________ > > Backgroundrb-devel mailing list > > Backgroundrb-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > Jonathan- > > > > > > If your worker is done and not doing any more computation you can just > call kill from within your worker. If it is still working on something and > you need its thread to be killed also you can do like this: > > > > > > ::BackgrounDRb::MiddleMan.instance.delete_worker > @_job_key > > > > > > -Ezra > > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > >-- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com
Thank you Charles! Ruby for Rails is already in my Amazon wish list ;-) On 9/6/06, Charles Brian Quinn <me at seebq.com> wrote:> > the :: means, start the class/module lookup at the root, so as not to > conflict with any class/module namespaces you might already have. > > If you have a class you''ve defined called, say Violin, and it has a > module or maybe a subclass called String (since violins have strings, > get it?), then, if you wanted to create an actual String to deal with > letters, you''d have to create it like so: > > ::String.new("A") > > because just saying: > > String.new("A") > > would find your Violin::String before it found the real String class. > > it''s like in xpath, putting the // will return you to the root of the > doc to perform lookups. > > If you''re interested, the Ruby for Rails book has more on this (and > uses the same example that I blantantly stole). > > On 9/6/06, Jonathan M?tillon <jmetillon at gmail.com> wrote: > > Thanks Ezra that works very well! > > > > Can you tell me what means the :: at the start of the line? > > > > > > On 9/1/06, Ezra Zygmuntowicz < ezmobius at gmail.com> wrote: > > > > > > > > > > > > > > > > > > > > > On Sep 1, 2006, at 8:00 AM, Jonathan M?tillon wrote: > > > > > > > > > > > > Hi the list people, hi Ezra, > > > > > > I just read from this message > > http://rubyforge.org/pipermail/backgroundrb-devel/2006-July/000134.html > > that BackgrounDRb will offer a way to kill a worker from within itself. > > > > > > As this message is from 7/25, I wonder if this feature has been added > > since. If not, is there any way to do it? I tried this: > > > > > > MiddleMan.delete_worker (@_job_key) > > > > > > But it raise: > > > > > > uninitialized constant MiddleMan - (NameError) > > > > > > Thanks > > > > > > Jonathan > > > > > > > > > _______________________________________________ > > > Backgroundrb-devel mailing list > > > Backgroundrb-devel at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > > > Jonathan- > > > > > > > > > If your worker is done and not doing any more computation you can just > > call kill from within your worker. If it is still working on something > and > > you need its thread to be killed also you can do like this: > > > > > > > > > ::BackgrounDRb::MiddleMan.instance.delete_worker > > @_job_key > > > > > > > > > -Ezra > > > > > > _______________________________________________ > > Backgroundrb-devel mailing list > > Backgroundrb-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > > > > -- > Charles Brian Quinn > self-promotion: www.seebq.com > highgroove studios: www.highgroove.com > slingshot hosting: www.slingshothosting.com >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060906/f7bb0bba/attachment.html
On Sep 6, 2006, at 5:00 AM, Jonathan M?tillon wrote:> I wonder why Ezra proposed the delete_worker method if a kill > method exists? Maybe it''s a brand new feature? i was not aware of > it and found nothing about this while googling. > > On 9/6/06, Chris Roos <chrisjroos at gmail.com> wrote: > There is also a kill method for a worker, so I believe (and it seems > to work) that you can just use kill (or self.kill) in place of the > above chain. > > The :: references the top level namespace. > > Chris > >There is a kill method you can call in your worker. I need to update it however because while it does delete the worker out of the @jobs and @timestamps hashes, it doesnt actualy kill the running thread. There will be a new release soon that addresses this issue. -Ezra -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060906/ab96af55/attachment.html
And does ::BackgrounDRb::MiddleMan.instance.delete_worker @_job_key actually kill the thread? On 9/6/06, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:> > > On Sep 6, 2006, at 5:00 AM, Jonathan M?tillon wrote: > > I wonder why Ezra proposed the delete_worker method if a kill method > exists? Maybe it''s a brand new feature? i was not aware of it and found > nothing about this while googling. > > On 9/6/06, Chris Roos <chrisjroos at gmail.com> wrote: > > > > There is also a kill method for a worker, so I believe (and it seems > > to work) that you can just use kill (or self.kill) in place of the > > above chain. > > > > The :: references the top level namespace. > > > > Chris > > > > > > There is a kill method you can call in your worker. I need to update it > however because while it does delete the worker out of the @jobs and > @timestamps hashes, it doesnt actualy kill the running thread. There will be > a new release soon that addresses this issue. > > > -Ezra > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060907/84d35067/attachment-0001.html
Yes. I''m sorry for the confusion about that. -Ezra On Sep 7, 2006, at 5:17 AM, Jonathan M?tillon wrote:> And does > > ::BackgrounDRb::MiddleMan.instance.delete_worker @_job_key > > actually kill the thread? > > > On 9/6/06, Ezra Zygmuntowicz < ezmobius at gmail.com> wrote: > > On Sep 6, 2006, at 5:00 AM, Jonathan M?tillon wrote: > >> I wonder why Ezra proposed the delete_worker method if a kill >> method exists? Maybe it''s a brand new feature? i was not aware of >> it and found nothing about this while googling. >> >> On 9/6/06, Chris Roos <chrisjroos at gmail.com > wrote: >> There is also a kill method for a worker, so I believe (and it seems >> to work) that you can just use kill (or self.kill) in place of the >> above chain. >> >> The :: references the top level namespace. >> >> Chris >> >> > > There is a kill method you can call in your worker. I need to > update it however because while it does delete the worker out of > the @jobs and @timestamps hashes, it doesnt actualy kill the > running thread. There will be a new release soon that addresses > this issue. > > > -Ezra > > > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060907/54b84fd8/attachment.html