# Spawner 1.0.0

**URL:** <https://www.ruby-forum.com/t/spawner-1-0-0/148607>\
**Category:** Ruby\
**Created:** [September 15, 2008, 3:58pm UTC](https://www.ruby-forum.com/t/spawner-1-0-0/148607 "2008-09-15T15:58:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [September 15, 2008, 3:58pm UTC](https://www.ruby-forum.com/t/spawner-1-0-0/148607/1 "2008-09-15T15:58:05Z")

</div>

spawner version 1.0.0  
by Tim P.  
[http://codeforpeople.rubyforge.org/spawner](http://codeforpeople.rubyforge.org/spawner)

== DESCRIPTION

Spawn multiple child processes from Ruby and re-spawn those processes if  
they die.

Spawner works on Mac OS X, Linux, Windows, Solaris, AIX – anywhere that  
Ruby can run. It is useful for load testing other applications or just  
keeping things alive. The Spawner class allows the number of child  
processes to be changed dynamiclly so they can be brought up and down as  
needed without restarting the spawner.

There is also a handy command line spawner app that’s really useful for  
load testing services – spawn twenty clients and see how things hold  
up.

== CHANGES

- 1 major enhancement
  - Birthday!

== SYNOPSIS

Start three ‘foo’ processes and re-spawn immediately when one dies.

spawner = Spawner.new( ‘foo’, :spawn =\> 3 )  
spawner.start

Start two ‘bar’ processes, pause for 10 seconds before re-spawning, and  
capture output to a file.

spawner = Spawner.new( ‘bar’, :spawn = 2, :pause =\> 10, :stdout =\>  
‘stdout.txt’ )  
spawner.start

Start 10 ‘baz’ process and kill off one process each minute until none  
are left running.

spawner = Spawner.new( ‘baz’, :spawn =\> 10 )  
spawner.start

until (spawner.spawn == 0)  
sleep 60  
spawner.spawn -= 1  
end

== INSTALL:

sudo gem install spawner

Blessings,  
TwP
