README.md in cloudist-0.4.3 vs README.md in cloudist-0.4.4
- old
+ new
@@ -9,106 +9,45 @@
or even just sending emails. Unlike other job queues (DelayedJob etc) Cloudist does not load your entire Rails stack into memory for every worker, and it is not designed to, instead it expects all the data your worker requires to complete a job to be sent in the initial job request. This means your workers stay slim and can scale very quickly and even run on EC2 micros outside your applications environment without any further configuration.
Installation
------------
- gem install cloudist
+```bash
+gem install cloudist
+```
Or if your app has a Gemfile:
-
- gem 'cloudist'
+```ruby
+gem 'cloudist', '~> 0.4.4'
+```
+
Usage
-----
-Cloudist requires an EventMachine reactor loop and an AMQP connection, so if your application is already using one, or your web server supplies one (for example Thin) these examples will work out of the box. Otherwise simply wrap everything inside this block:
-
- Cloudist.start {
- # usual stuff here
- job('make.sandwich') {
- # define a job handler
- }
- }
-
-This will start an AMQP connection and EM loop then yield everything inside it.
+**Refer to examples.**
-In your worker:
-
- Cloudist.start {
- log.info("Started Worker")
-
- job('make.sandwich') {
- log.info("JOB (#{id}) Make sandwich with #{data[:bread]} bread")
-
- job.started!
-
- (1..20).each do |i|
- job.progress(i * 5)
- sleep(1)
- end
- job.finished!
- }
-
- }
-
-In your application:
-
- Cloudist.start {
-
- log.info("Dispatching sandwich making job...")
-
- Cloudist.enqueue('make.sandwich', {:bread => 'white', :sandwich_number => 1})
-
- # Listen to all sandwich jobs
- listen('make.sandwich') {
- everything {
- Cloudist.log.info("#{headers[:message_type]} - Job ID: #{job_id}")
- }
-
- # This will contain any exceptions which are raised while processing the job, which will halt the job
- error { |e|
- Cloudist.log.error(e.inspect)
- Cloudist.log.error(e.backtrace.inspect)
-
- # Exit on failure
- Cloudist.stop
- }
-
- # Process progress updates
- progress {
- Cloudist.log.info("Progress: #{data[:progress]}")
- }
-
- event('started') {
- Cloudist.log.info("Started making sandwich at #{Time.now.to_s}")
- }
-
- event('finished'){
- Cloudist.log.info("Finished making sandwich at #{Time.now.to_s}")
- # Exit when done
- Cloudist.stop
- }
- }
-
- }
-
-
-If your application provides an AMQP.start loop already, you can skip the Cloudist.start
-
Configuration
-------------
The only configuration required to get going are the AMQP settings, these can be set in two ways:
1. Using the `AMQP_URL` environment variable with value of `amqp://username:password@localhost:5672/vhost`
2. Updating the settings hash manually:
-
-
- Cloudist.settings = {:user => 'guest', :pass => 'password', :vhost => '/', :host => 'localhost', :port => 5672}
-
+```ruby
+Cloudist.settings = {:user => 'guest', :pass => 'password', :vhost => '/', :host => 'localhost', :port => 5672}
+```
+
+Now and what's coming
+---------------------
+
+Cloudist was developed to provide the messaging layer used within TestPilot [Continuous Integration](http://testpilot.me) service.
+
+TestPilot still uses [Cloudist](http://testpilot.me/ivan/cloudist) heavily and a number of features will be merged in soon.
+
Acknowledgements
----------------
Portions of this gem are based on code from the following projects:
@@ -128,10 +67,10 @@
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Authors
-------
-Ivan Vanderbyl - [@IvanVanderbyl](http://twitter.com/IvanVanderbyl) - [Blog](http://ivanvanderbyl.github.com/)
+[IvanVanderbyl](http://testpilot.me/ivan) - [Blog](http://ivanvanderbyl.github.com/)
Copyright
---------
Copyright (c) 2011 Ivan Vanderbyl.