<commit_before># Qu

Qu is a Ruby library for queuing and processing background jobs. It is heavily inspired by delayed_job and Resque.

Qu was created to overcome some shortcomings in the existing queuing libraries that we experienced at [Ordered List](http://orderedlist.com) while building [SpeakerDeck](http://speakerdeck.com), [Gaug.es](http://get.gaug.es) and [Harmony](http://get.harmonyapp.com). The advantages of Qu are:

* Multiple backends (redis, mongo)
* Jobs are requeued when worker is killed
* Resque-like API

## Information & Help

* Find more information on the [Wiki](https://github.com/bkeepers/qu/wiki).
* Post to the [Google Group](http://groups.google.com/group/qu-users) for help or questions.
* See the [issue tracker](https://github.com/bkeepers/qu/issues) for known issues or to report an issue.

## Installation

### Rails

Decide which backend you want to use and add the gem for it to your `Gemfile`.

``` ruby
gem 'qu-redis'
```
If you are using a version of Rails that does not support Railtie (so, not Rails 3), you need to create a rake task to load the Qu tasks. So, create `lib/tasks/qu.rake` with the contents

``` ruby
require 'qu/tasks'
```

That's all you need to do!

## Usage

Jobs are any class that responds to the `.perform` method:

``` ruby
class ProcessPresentation
  def self.perform(presentation_id)
    presentation = Presentation.find(presentation_id)<commit_msg>Update docs for Rails 2<commit_after># Qu

Qu is a Ruby library for queuing and processing background jobs. It is heavily inspired by delayed_job and Resque.

Qu was created to overcome some shortcomings in the existing queuing libraries that we experienced at [Ordered List](http://orderedlist.com) while building [SpeakerDeck](http://speakerdeck.com), [Gaug.es](http://get.gaug.es) and [Harmony](http://get.harmonyapp.com). The advantages of Qu are:

* Multiple backends (redis, mongo)
* Jobs are requeued when worker is killed
* Resque-like API

## Information & Help

* Find more information on the [Wiki](https://github.com/bkeepers/qu/wiki).
* Post to the [Google Group](http://groups.google.com/group/qu-users) for help or questions.
* See the [issue tracker](https://github.com/bkeepers/qu/issues) for known issues or to report an issue.

## Installation

### Rails 3

Decide which backend you want to use and add the gem to your `Gemfile`.

``` ruby
gem 'qu-redis'
```

That's all you need to do!

### Rails 2

Decide which backend you want to use and add the gem to `config.gems` in `environment.rb`:

``` ruby
config.gem 'qu-redis'
````

To load the rake tasks, add the following to your `Rakefile`:

``` ruby
require 'qu/tasks'
```

## Usage

Jobs are any class that responds to the `.perform` method:

``` ruby
class ProcessPresentation
  def self.perform(presentation_id)
    presentation = Presentation.find(presentation_id)
{'fraction_non_alphanumeric': 0.10928196147110333, 'fraction_numerical': 0.0014010507880910684, 'mean_word_length': 4.378531073446328, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6730742', 'n_tokens_mistral': 907, 'n_tokens_neox': 847, 'n_words': 348}