README.md in sideband-1.0.2 vs README.md in sideband-1.0.3

- old
+ new

@@ -1,15 +1,16 @@ # Sideband +[![Build Status](https://api.travis-ci.org/mje113/sideband.png)](http://travis-ci.org/mje113/sideband) +[![Code Climate](https://codeclimate.com/github/mje113/sideband.png)](https://codeclimate.com/github/mje113/sideband) +[![Coverage Status](https://coveralls.io/repos/mje113/sideband/badge.png)](https://coveralls.io/r/mje113/sideband) +[![Dependency Status](https://gemnasium.com/mje113/sideband.png)](https://gemnasium.com/mje113/sideband) + Run simple jobs in a separate sideband thread. Sideband makes it easy to pass small jobs off to a separate in-process thread. It makes no attempt to handle errors, nor return any results. Its primary focus is queueing up potentially IO blocking bits of code, where the results of which are not necessarily vital to your application's business logic. -Use cases: -* - - ## Installation Add this line to your application's Gemfile: gem 'sideband' @@ -28,12 +29,10 @@ ```ruby Sideband.initialize! ``` -In theory you can create one Sideband thread per thread, however it's most useful in your main thread. - To pass work off to Sideband, you can add anything that is callable (procs, lambdas, workers) to its queue: ```ruby Sideband.queue << -> { Something.expensive } ``` @@ -60,26 +59,20 @@ # or Sideband::Workers can enqueue themselves Metricworker.new(params[:metric]).enqueue ``` -## Use Cases - - +A practical Rails example: ```ruby -@user = User.create(params[:user]) -Sideband.queue << -> { UserMailer.welcome_email(@user).deliver } -render :welcome -``` +class UsersController < ApplicationController -## Code Status - -[![Build Status](https://api.travis-ci.org/mje113/sideband.png)](http://travis-ci.org/mje113/sideband) -[![Code Climate](https://codeclimate.com/github/mje113/sideband.png)](https://codeclimate.com/github/mje113/sideband) - -## Code Status - -[![Code Climate](https://codeclimate.com/github/mje113/sideband.png)](https://codeclimate.com/github/mje113/sideband) + def create + @user = User.create(params[:user]) + Sideband.queue << -> { UserMailer.welcome_email(@user).deliver } + render :welcome + end +end +``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`)