Project

angael

0.0
No commit activity in last 3 years
No release in over 3 years
Angael is a lightweight library for running repetitive background processes. It handles the forking and signal catching, allow you to just define what the background workers should do.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

 Project Readme

Angael

Angael is a lightweight library for running repetitive background processes. It handles the forking and signal catching, allow you to just define what the background workers should do.

Documentation

Angael's model of running background processes involves two classes: a worker and a manager.

Theoretically you do not need to modify Angael's built in manager (Angael::Manager). It already has the basic logic for starting and stopping the workers.

Since workers are very different depending on the task at hand, Angael doesn't include a Worker class. Instead there is just a module (Angael::Worker) which you can include into your own class. When you include Angael::Worker your class is expected to define a method called work. This method will be called repeatedly until the the worker is stopped. Also note, Angael::Worker defines an initialize method. If you require your own initializer, take care that you either call super or you set the appropriate instance variables.

Example

class MailMan
  include Angael::Worker
  def work
    deliver_letters
  end

  def deliver_letters
    # Your cool code
  end
end

mail_man_manager = Angael::Manager.new(MailMan)

# This will loop forever until it receives a SIGINT or SIGTERM.
mail_man_manager.start!

Setup

Gemfile

gem 'angael', :git => 'git://github.com/thoughtless/angael.git'

bundle install

Contribute

See http://github.com/thoughtless/angael