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

  1. Fork it ( http://github.com//spawncamp/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request