Spawncamp
Small library for spawning and managing child processes
Installation
Add this line to your application's Gemfile:
gem 'spawncamp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install spawncamp
Usage
simply include the library and have access Spawncamp::spawn
and Spawncamp::spawn_loop
Spawncamp::Base::spawn
require 'spawncamp'
proc = puts 'child_process'
Spawncamp::spawn(proc)
Spawncamp::spawn(proc)
Spawncamp::spawn(proc)
Spawncamp::spawn(proc)
Spawncamp::spawn(proc)
Spawncamp::Base::spawn_loop
spawning loops is drastic so beware, this is a non killable process
require 'spawncamp'
proc = puts 'constant process i will never die!'
Spawncamp::spawn_loop(proc)
Spawncamp::Stats::get_current_process
retreive current process id (pid)
require 'spawncamp'
Spawncamp::Stats::get_current_process
Spawncamp::Stats::get_running_processes
retreive list of currently running process id's (pids)
require 'spawncamp'
Spawncamp::Stats::get_running_processes
API
generate api docs by running
$ rake docs
hosted docs are avalible Here
Contributing
- Fork it ( http://github.com/
/spawncamp/fork ) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request