# Killing off zombie backgroundRB processes?

**URL:** <https://www.ruby-forum.com/t/killing-off-zombie-backgroundrb-processes/113648>\
**Category:** Rails\
**Created:** [September 3, 2007, 2:30pm UTC](https://www.ruby-forum.com/t/killing-off-zombie-backgroundrb-processes/113648 "2007-09-03T14:30:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e480ec/32.png) [@mikel](https://www.ruby-forum.com/u/mikel)\
**Post date:** [September 3, 2007, 2:30pm UTC](https://www.ruby-forum.com/t/killing-off-zombie-backgroundrb-processes/113648/1 "2007-09-03T14:30:27Z")

</div>

Hello,

I have a mailer that mails out our mailing list emails. I run this by  
passing control to send the emails out to a backgrounDRB task. this  
works great.

But I can’t seem to kill them off! I end up with several BackgrounDRB  
tasks running.

I looked at using the named type of BackgrounDRB task and only ever  
using one, but there are times when two newsletters go out, and this  
obviously won’t work.

Using the worker.delete command isn’t suitable as I don’t know how  
long a mailout will take.

I thought about naming each worker, then putting this into an AR  
model, then running another backgrounDRB task or cronjob that logs in,  
checks the table to see which workers are complete and do a  
worker.delete… but I can’t quite get that working.

What I am after (that I haven’t found) is something like a “self.kill”  
that i could put at the end of the do\_work method as once the do\_work  
method is complete, the backgrounDRB task should unload.

Any working ideas?

Thanks

Mikel
