<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks again,</FONT></DIV>
<DIV><FONT face=Arial size=2>Bill</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=michael.dauria@gmail.com
href="mailto:michael.dauria@gmail.com">Michael D'Auria</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=bill.walton@charter.net
href="mailto:bill.walton@charter.net">Bill Walton</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=eden.li@gmail.com
href="mailto:eden.li@gmail.com">Eden Li</A> ; <A
title=backgroundrb-devel@rubyforge.org
href="mailto:backgroundrb-devel@rubyforge.org">BackgroundRb</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, October 23, 2006 3:28
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Backgroundrb-devel] can a
worker commit suicide?</DIV>
<DIV><BR></DIV>
<DIV>You can have the worker delete itself, just make sure you call
ActiveRecord::Base.connection.disconect! first:</DIV>
<DIV> </DIV>
<DIV>ActiveRecord::Base.connection.disconect!</DIV>
<DIV>::BackgrounDRb::MiddleMan.instance.delete_worker @_job_key</DIV>
<DIV> </DIV>
<DIV>That shoudl ensure the db connection has been closed and delete the
instance of the current worker<BR><BR> </DIV>
<DIV><SPAN class=gmail_quote>On 10/23/06, <B class=gmail_sendername>Bill
Walton</B> <<A
href="mailto:bill.walton@charter.net">bill.walton@charter.net</A>>
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi
Eden,<BR><BR>Eden Li wrote:<BR><BR>> ... you can specify a :ttl(time to
live) in seconds and your worker will <BR>> get killed after those
seconds run out.<BR><BR>I'm using BackgrounDRb to monitor session activity
and deleting user entered<BR>data in the database when their session times
out. Every time they do<BR>something, their time-til-timeout gets
reset. There's no notion of a max <BR>time. As long as
they keep using the app, their session stays alive.<BR><BR>I was wondering
if there's a way, inside the worker, to do the
equivalent<BR>of:<BR>MiddleMan.delete_worker(session[:job_key])<BR><BR>Thanks,
<BR>Bill<BR>_______________________________________________<BR>Backgroundrb-devel
mailing list<BR><A
href="mailto:Backgroundrb-devel@rubyforge.org">Backgroundrb-devel@rubyforge.org</A><BR><A
href="http://rubyforge.org/mailman/listinfo/backgroundrb-devel">http://rubyforge.org/mailman/listinfo/backgroundrb-devel</A><BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>