# Backgroundb question

**URL:** <https://www.ruby-forum.com/t/backgroundb-question/109712>\
**Category:** Ruby\
**Created:** [July 18, 2007, 7:40am UTC](https://www.ruby-forum.com/t/backgroundb-question/109712 "2007-07-18T07:40:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ther](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@ther](https://www.ruby-forum.com/u/ther)\
**Post date:** [July 18, 2007, 7:40am UTC](https://www.ruby-forum.com/t/backgroundb-question/109712/1 "2007-07-18T07:40:15Z")

</div>

Two actualy:

1. How to automatically delete worker when the job is done?
2. Must the backgroundrb be restarted if the worker code has changed. Or  
is there another way.  
If it has anything to do with this I have :rails\_env: development

by  
TheR

---

<div class="post-metadata">

**Author:** ![ther](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@ther](https://www.ruby-forum.com/u/ther)\
**Post date:** [July 18, 2007, 7:51am UTC](https://www.ruby-forum.com/t/backgroundb-question/109712/2 "2007-07-18T07:51:43Z")

</div>

On 7/18/07, Damjan R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Two actualy:
> 
> 1. How to automatically delete worker when the job is done?
> 2. Must the backgroundrb be restarted if the worker code has changed. Or  
> is there another way.  
> If it has anything to do with this I have :rails\_env: development
> 
> by  
> TheR

for deleting a worker, when its done, you can call self.delete from  
worker or worker.delete from outside, where worker is an instance of  
your worker. You can also call exit from the end of worker to stop its  
existence(this works because, each of your worker is a process of its  
own).

Yes, you need to restart your worker, if you have changed code and it  
has nothing to do with rails environment you are in.

–  
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://blog.gnufied.org](http://blog.gnufied.org)
