OVERVIEW

Project xpool
Homepage https://github.com/johnny5-/xpool
Documentation http://rubydoc.info/github/johnny5-/xpool
CI Build Status

DESCRIPTION

!kind of dormant, sitting on the shelf of ideas!

A lightweight(223 lines of code) process pool that can use redis or unix sockets when queueing messages(jobs) for child processes.

EXAMPLES

1.

demo of how to schedule a unit of work (with unix sockets):

class Unit
  def run
    puts Process.pid
  end

  #
  # In case of error, this method will be invoked. The unit of work
  # is not put back on the queue (nevermind a lower priority queue)
  # but it's on my radar. Any exceptions raised in this method are
  # swallowed.
  #
  def recover(e)
    Bugsnag.notify(e)
  end
end
pool = XPool.unix 2
pool.schedule Unit
pool.shutdown

2.

demo of XPool::Process objects.

class Unit
  def run
    sleep 1
  end
end
pool = XPool.unix 2
process = pool.schedule Unit
p process.busy?
pool.shutdown

INSTALL

$ gem install xpool

LEGAL

see LEGAL.txt