[Backgroundrb-devel] can a worker commit suicide?
Bill Walton
bill.walton at charter.net
Mon Oct 23 18:20:16 EDT 2006
Thank you, Michael. I'm only disconnecting that particular worker, right? It looks like it, since I can restart the app (browse to it again) and everything looks to work ok. But I thought I'd ask. Also, is there any way to tell how many workers are running? I'm on Windows XP and all I can see with Task Mgr. is a ruby.exe process for BackgrounDRb.
Thanks again,
Bill
----- Original Message -----
From: Michael D'Auria
To: Bill Walton
Cc: Eden Li ; BackgroundRb
Sent: Monday, October 23, 2006 3:28 PM
Subject: Re: [Backgroundrb-devel] can a worker commit suicide?
You can have the worker delete itself, just make sure you call ActiveRecord::Base.connection.disconect! first:
ActiveRecord::Base.connection.disconect!
::BackgrounDRb::MiddleMan.instance.delete_worker @_job_key
That shoudl ensure the db connection has been closed and delete the instance of the current worker
On 10/23/06, Bill Walton <bill.walton at charter.net> wrote:
Hi Eden,
Eden Li wrote:
> ... you can specify a :ttl(time to live) in seconds and your worker will
> get killed after those seconds run out.
I'm using BackgrounDRb to monitor session activity and deleting user entered
data in the database when their session times out. Every time they do
something, their time-til-timeout gets reset. There's no notion of a max
time. As long as they keep using the app, their session stays alive.
I was wondering if there's a way, inside the worker, to do the equivalent
of:
MiddleMan.delete_worker(session[:job_key])
Thanks,
Bill
_______________________________________________
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/20061023/7fda71ff/attachment.html
More information about the Backgroundrb-devel
mailing list