README.md in disque-0.0.1.alpha vs README.md in disque-0.0.2

- old
+ new

@@ -1,21 +1,42 @@ Disque.rb ========= Client for Disque, an in-memory, distributed job queue. -Status ------- +Usage +----- -Disque is expected to be RESP compatible, and that means most Redis -transport clients will be able to connect to it and run any command. -This library is thus an imaginary client for Disque, but one that -should work at least at a very basic level and connect to one node. +Create a new Disque client by passing a list of nodes: +```ruby +client = Disque.new(["127.0.0.1:7711", "127.0.0.1:7712", "127.0.0.1:7713"]) +``` + +Now you can add jobs: + +```ruby +client.push("foo", "bar", 100) +``` + +It will push the job "bar" to the queue "foo" with a timeout of 100 +ms, and return the id of the job if it was received and replicated +in time. + +Then, your workers will do something like this: + +```ruby +loop do + client.fetch(from: ["foo"]) do |job| + # Do something with `job` + end +end +``` + Installation ------------ -You will be able to install it with RubyGems. +You can install it using rubygems. ``` $ gem install disque ```