Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ujihisa/tasks

This project is no longer active. See open5 instead. http://github.com/ujihisa/open5
https://github.com/ujihisa/tasks

Last synced: about 1 month ago
JSON representation

This project is no longer active. See open5 instead. http://github.com/ujihisa/open5

Awesome Lists containing this project

README

        

# Tasks -- Better Process Manager for Ruby

![Traffic Control](http://farm4.static.flickr.com/3118/3204377933_8c978370db.jpg)

## spawn

`tasks` provides `spawn` even in ruby 1.8.

require 'tasks'
include Tasks

pid = spawn './something.rb'
...
system "kill #{pid}"

`spawn` is like system with `'&'` and it also returns the procces id.

## love_pact

`tasks` supports a couple to do a love pact.

require 'tasks'
include Tasks

master_pid = spawn './master.rb'
slave_pid = spawn './slave.rb'

fork do
love_pact master_pid, slave_pid
end

If a master died, the slave dies immediately.

Note that now `love_pact` works only in UNIX.