<commit_before>Stooge
======

Stooge is a fully EventMachine enabled DSL for interacting with an AMQP broker. Heavily inspired by Minion (but fresher and completely asynchronous).

Setup
-----

Assuming you already have an AMQP broker installed:

    $ gem install stooge

You can configure the address to the broker using ```AMQP_URL``` environment variable or programmatically like this:

    Stooge.amqp_url = 'amqp://johndoe:abc123@localhost/my_vhost'

The default if not specified is ```amqp://guest:guest@localhost/```.

Example usage
-------------

To process a job add the following to a file called ```worker.rb``` and run it with ```ruby worker.rb```. Stooge will start an EventMachine loop that waits for AMQP messages and and processes matching jobs until you send ```SIG_INT``` or ```SIG_TERM``` to it.

```ruby
require 'stooge'

Stooge.job('example.puts') do |args|
  puts args[:message]
end
```

To push a job onto a queue you call ```Stooge.enqueue``` with the name of the work queue and the data you want to process. The data needs to be JSON serializable and can be for example a hash.

```ruby
require 'stooge'

EM.run do
  Stooge.enqueue('example.puts', :message => 'Hello, world!')
end
```

Author
------

Stooge was created by <NAME> (<EMAIL>) with help from Martin Bruse and released under the MIT license.

Heavily inspired by Minion (created by Orion Henry), Resque (created by <NAME>) and Stalker (created by <NAME>).<commit_msg>Fixed typos in README.<commit_after>Stooge
======

Stooge is a fully EventMachine enabled DSL for interacting with an AMQP broker. Heavily inspired by Minion (but fresher and completely asynchronous).

Setup
-----

Assuming you already have an AMQP broker installed:

    $ gem install stooge

You can configure the address to the broker using the ```AMQP_URL``` environment variable, or programmatically like this:

```ruby
Stooge.amqp_url = 'amqp://johndoe:abc123@localhost/my_vhost'
```

The default if not specified is ```amqp://guest:guest@localhost/```.

Example usage
-------------

To process a job add the following to a file called ```worker.rb``` and run it with ```ruby worker.rb```. Stooge will start an EventMachine loop that waits for AMQP messages and processes matching jobs until you send ```SIG_INT``` or ```SIG_TERM``` to it.

```ruby
require 'stooge'

Stooge.job('example.puts') do |args|
  puts args[:message]
end
```

To push a job onto a queue you call ```Stooge.enqueue``` with the name of the work queue and the data you want to process. The data needs to be JSON serializable and can be for example a hash.

```ruby
require 'stooge'

EM.run do
  Stooge.enqueue('example.puts', :message => 'Hello, world!')
end
```

Author
------

Stooge was created by <NAME> (<EMAIL>) with help from <NAME> (@zond) and released under the MIT license. Stooge is very much inspired by Minion (created by Orion Henry), Resque (created by <NAME>) and Stalker (created by <NAME>).
{'fraction_non_alphanumeric': 0.11798707922475349, 'fraction_numerical': 0.002040122407344441, 'mean_word_length': 4.188712522045855, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 14, 'https://': 0, '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': '3326936', 'n_tokens_mistral': 913, 'n_tokens_neox': 855, 'n_words': 398}