Project

traut

0.0
No commit activity in last 3 years
No release in over 3 years
Unix cron is a venerable program that turns the passage of time into program invokation. Traut does the same, but using AMQP events to trigger execution. AMQP message payloads are written to the stdin of invoked commands.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.9.2
~> 1.6.5
~> 2.4
 Project Readme

Traut -- a cron-like for AMQP

Unix cron's an ancient program that runs a script dependent on the passage time. Traut's the same way, except it keys off AMQP events instead. Use it to update your Puppet machines or log-rotate if nagios sends a disk-full warning. Significant number of possibilities.

Traut cannot daemonize itself. Use supervisord or similar to daemonize Traut; the code needed to achieve self-daemonization is outside of the core focus of this program.

Installation

Traut is distributed through the RubyGems

gem install traut

You're tasked with providing your own init scripts and configuration files. See the contents of etc/ for an example traut.conf. Note that traut.conf.sample defines a script deploy/app to be run in response to com.carepilot.event.code.review.app events, making its full path /tmp/traut/scripts/deploy/app.

Configuration

The source distribution has an etc/ directory with example configuration.

Use

Run traut from the root of the project like this:

bundle exec bin/traut -C etc/traut.conf

Now, using hare:

$ hare --exchange_name traut --exchange_type topic --route_key whatthesum
--producer "that wasn't so bad"

You should see nothing. Open up another terminal and

$ hare --exchange_name traut --exchange_type topic --route_key 'whatthesum.exited'

Note that the route key is the same as before, save that '.exited' has been appended to it. Listen to this channel if you need notification of success. Run both hare commands in the order presented, notice the second print a json hash.

See the sample configuration file for more details.