Project

react

0.0
No commit activity in last 3 years
No release in over 3 years
A simple application that allows for remote execution of commands.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.0
>= 2.1
>= 2.0
 Project Readme

React

React is a simple application that allows for remote execution of commands, and it uses Redis as a queue.

Inspiration

It's inspired by Simon Willison's example of "Queue-activated shell scripts" in his redis tutorial:

while [ 1 ] do
  redis-cli blpop restart-httpd 0
  apache2ctl graceful
done

Installation

You can simply install React using rubygems:

sudo gem install react

Usage

Firs you have to prepare file with available commands. It can look like this:

# my_commands.yml
restart_httpd: apache2ctl graceful
restart_mysql: /etc/init.d/mysql restart
reboot: reboot

And now you can start a consumer.

react my_commands.yml

Pushing commands

While your consumer is working, you can push any of specified command to
queue (default queue name is queue), eg:

redis-cli lpush queue restart_httpd
redis-cli lpush queue reboot

After that consumer will pick up enqueued command names from and execute related commands.

Configuration

There are few more runtime options, which can be useful for you.

  • you can specify queue which will be consumed:

    react my_commands.yml --queue "my:queue:name"
    
  • you can specify the database to which consumer should connect:

    react my_commands.yml --host "yourhost.com" --port 6379 --db 2 --password pass
    
  • and finally, you can demonize the consumer:

    react my_commands.yml --daemon
    

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright

== Copyright

Copyleft 2010 Chris Kowalik. WTFPL Baby!

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  1. You just DO WHAT THE FUCK YOU WANT TO.