simple_queues 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format doc
data/README.textile CHANGED
@@ -1,24 +1,30 @@
1
1
  h1. SimpleQueues
2
2
 
3
- In the Gang of Four books, one of the first few lines is "Program to an interface, not an implementation." When you need a queue, the only operations you need are enqueue and dequeue. It doesn't matter that Redis (a nice and simple queue server when you need it) has all kinds of operations available.
3
+ In the Gang of Four books, one of the first few lines is "Program to an interface, not an implementation." When you need a queue, the only operations you need are enqueue and dequeue. It doesn't matter that Redis (a nice and simple queue server when you need it) has a ton of extra features which we aren't going to use.
4
4
 
5
- This library was written and spec'd on Ruby 1.9.2. It's so small it should work anywhere the Redis gem works.
5
+ This library was written and spec'd on Ruby 1.9.2. It is also in use, in production, on JRuby in 1.8 mode.
6
6
 
7
7
  h2. Exceptions
8
8
 
9
- All underlying exceptions the Redis gem raises are let through: no extra exceptions are raised. This means you'll see <code>Errno::ECONNREFUSED</code>, <code>Errno::EAGAIN</code> and friends.
9
+ All underlying exceptions the Redis gem raises are let through. This means you'll see <code>Errno::ECONNREFUSED</code>, <code>Errno::EAGAIN</code> and friends. Of course, you may also receive ArgumentError if you do something bad.
10
10
 
11
11
  h2. Usage
12
12
 
13
13
  <pre><code>require "simple_queues"
14
+ # Sane defaults:
15
+ # * Defaults to a Redis instance at 127.0.0.1:6379, database 0
16
+ # * Defaults to the JSON encoder
14
17
  Queues = SimpleQueues::Redis.new
15
18
 
16
- Queues.enqueue :pages_to_crawl, :url => "http://blog.teksol.info"
17
- Queues.enqueue :pages_to_crawl, :url => "http://techcrunch.com"
19
+ Queues.enqueue :pages_to_crawl, :url => "http://blog.teksol.info/"
20
+ Queues.enqueue :pages_to_crawl, :url => "http://techcrunch.com/"
18
21
 
19
22
  # In another process
20
23
 
24
+ Queues = SimpleQueues::Redis.new(Redis.new("192.168.1.9", 9281), :encoder => :json)
25
+
21
26
  loop do
27
+ # This blocks until a message is dequeued.
22
28
  message = Queues.dequeue_blocking :pages_to_crawl
23
29
  process(message)
24
30
  end
@@ -30,6 +36,7 @@ loop do
30
36
  process(message)
31
37
  else
32
38
  # Timed out
39
+ break
33
40
  end
34
41
  end
35
42
  <code></pre>
data/lib/simple_queues.rb CHANGED
@@ -11,4 +11,8 @@
11
11
  # * +dequeue_blocking+
12
12
  module SimpleQueues
13
13
  autoload :Redis, "simple_queues/redis"
14
+
15
+ autoload :JsonEncoder, "simple_queues/encoders/json"
16
+ autoload :MessagePackEncoder, "simple_queues/encoders/message_pack"
17
+ autoload :IdentityEncoder, "simple_queues/encoders/identity"
14
18
  end
@@ -0,0 +1,11 @@
1
+ module SimpleQueues
2
+ class IdentityEncoder
3
+ def encode(message)
4
+ message
5
+ end
6
+
7
+ def decode(message)
8
+ message
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ require "json"
2
+
3
+ module SimpleQueues
4
+ class JsonEncoder
5
+ def encode(message)
6
+ JSON.generate(message)
7
+ end
8
+
9
+ def decode(message)
10
+ JSON.parse(message)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require "msgpack"
2
+
3
+ module SimpleQueues
4
+ class MessagePackEncoder
5
+ def encode(message)
6
+ MessagePack.pack(message)
7
+ end
8
+
9
+ def decode(message)
10
+ MessagePack.unpack(message)
11
+ end
12
+ end
13
+ end
@@ -6,7 +6,25 @@ module SimpleQueues
6
6
  #
7
7
  # Messages are enqueued to the right, dequeued from the left - thus the most recent messages are at the end of the list.
8
8
  class Redis
9
- def initialize(redis = ::Redis.new)
9
+ attr_reader :encoder
10
+
11
+ # @param redis A Redis instance, or something that looks like Redis.
12
+ # @param options [Hash] A set of options.
13
+ #
14
+ # @option :encoder [#decode, #encode, Symbol] Either one of the named encoders, or an object that responds to both +#encode+ and +#decode+. Defaults to :json.
15
+ def initialize(redis = ::Redis.new, options={})
16
+ @encoder = case options[:encoder]
17
+ when :messagepack, :msgpack
18
+ SimpleQueues::MessagePackEncoder.new
19
+ when :json, nil
20
+ SimpleQueues::JsonEncoder.new
21
+ when :identity
22
+ SimpleQueues::IdentityEncoder.new
23
+ else # Use whatever was provided
24
+ options[:encoder]
25
+ end
26
+ raise ArgumentError, "Provided encoder #{@encoder.inspect} does not handle #encode and #decode" unless @encoder.respond_to?(:encode) && @encoder.respond_to?(:decode)
27
+
10
28
  @redis = redis
11
29
  @queues = Hash.new
12
30
  end
@@ -15,14 +33,13 @@ module SimpleQueues
15
33
  @queues[q_name(queue_name)] = block
16
34
  end
17
35
 
18
- def serialize(message)
36
+ def encode(message)
19
37
  raise ArgumentError, "message must be non-nil" if message.nil?
20
- raise ArgumentError, "message must be respond to #to_json" unless message.respond_to?(:to_json)
21
- message.to_json
38
+ encoder.encode(message)
22
39
  end
23
40
 
24
- def deserialize(message)
25
- JSON.parse(message) if message
41
+ def decode(message)
42
+ encoder.decode(message) if message
26
43
  end
27
44
 
28
45
  # Enqueues a new message to the Redis backend.
@@ -32,7 +49,9 @@ module SimpleQueues
32
49
  # @return No useful value.
33
50
  # @raise ArgumentError Whenever the queue name or the message are nil, or the queue name is empty.
34
51
  def enqueue(queue_name, message)
35
- msg = serialize(message)
52
+ raise ArgumentError, "Only hashes are accepted as messages" unless message.is_a?(Hash)
53
+
54
+ msg = encode(message)
36
55
  @redis.rpush(q_name(queue_name), msg)
37
56
  msg
38
57
  end
@@ -67,12 +86,12 @@ module SimpleQueues
67
86
  raise ArgumentError, "Timeout must not be nil" if timeout.nil? || timeout.to_s.empty?
68
87
 
69
88
  queue, result = @redis.blpop(*[@queues.keys, timeout.to_i].flatten)
70
- @queues.fetch(queue).call(deserialize(result)) if queue
89
+ @queues.fetch(queue).call(decode(result)) if queue
71
90
  queue
72
91
  when 2
73
92
  queue_name, timeout = args.shift, args.shift
74
93
  _, result = @redis.blpop(q_name(queue_name), timeout.to_i)
75
- deserialize(result)
94
+ decode(result)
76
95
  else
77
96
  raise "NOT DONE"
78
97
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleQueues
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -18,9 +18,10 @@ Gem::Specification.new do |s|
18
18
  s.require_paths = ["lib"]
19
19
 
20
20
  s.add_dependency 'redis'
21
- s.add_dependency 'json'
22
21
  s.add_development_dependency 'rspec'
23
22
  s.add_development_dependency 'yard'
24
23
  s.add_development_dependency 'RedCloth'
25
24
  s.add_development_dependency 'ruby-debug19'
25
+ s.add_development_dependency 'msgpack'
26
+ s.add_development_dependency 'json'
26
27
  end
@@ -9,7 +9,7 @@ describe SimpleQueues::Redis, "dequeue_blocking" do
9
9
  SimpleQueues::Redis.new(redis)
10
10
  end
11
11
 
12
- it "requests an infinite timeout from Redis #blpop" do
12
+ it "request indefinitely at the Redis layer" do
13
13
  redis.should_receive(:blpop).with("pages_to_crawl", 0)
14
14
  queue.dequeue_blocking("pages_to_crawl")
15
15
  end
@@ -30,8 +30,12 @@ describe SimpleQueues::Redis, "dequeue_with_timeout" do
30
30
  double("redis")
31
31
  end
32
32
 
33
+ let :encoder do
34
+ double("encoder").as_null_object
35
+ end
36
+
33
37
  let :queue do
34
- SimpleQueues::Redis.new(redis)
38
+ SimpleQueues::Redis.new(redis, :encoder => encoder)
35
39
  end
36
40
 
37
41
  it "should call Redis' BLPOP with the requested timeout" do
@@ -46,11 +50,15 @@ describe SimpleQueues::Redis, "dequeue_with_timeout" do
46
50
 
47
51
  it "raises an ArgumentError when the queue name is nil or empty" do
48
52
  lambda { queue.dequeue_with_timeout(nil) }.should raise_error(ArgumentError)
49
- lambda { queue.dequeue_with_timeout("") }.should raise_error(ArgumentError)
53
+ lambda { queue.dequeue_with_timeout("") }.should raise_error(ArgumentError)
50
54
  end
51
-
52
- it "returns the unserialized object" do
53
- redis.should_receive(:blpop).with("test", 5).and_return(["test", "{\"hello\":\"world\",\"x\":42}"] )
54
- queue.dequeue_with_timeout(:test, 5).should == {"hello" => "world", "x" => 42}
55
+
56
+ it "should decode the message using the selected encoder" do
57
+ encoded_message = '{"hello":"world","x":42}'
58
+
59
+ redis.should_receive(:blpop).with("test", 5).and_return(["test", encoded_message])
60
+ encoder.should_receive(:decode).with(encoded_message).and_return("hello" => "world", "x" => 42)
61
+
62
+ queue.dequeue_with_timeout(:test, 5)
55
63
  end
56
64
  end
@@ -5,48 +5,60 @@ describe SimpleQueues::Redis, "enqueue" do
5
5
  double("redis")
6
6
  end
7
7
 
8
- let :queue do
9
- SimpleQueues::Redis.new(redis)
8
+ let :encoder do
9
+ double("encoder").as_null_object
10
10
  end
11
11
 
12
- it "should enqueue to the end of the list" do
13
- redis.should_receive(:rpush).with("q", '"message"')
14
- queue.enqueue("q", "message")
12
+ let :queue do
13
+ SimpleQueues::Redis.new(redis, :encoder => encoder)
15
14
  end
16
15
 
17
- it "should return the serialized message" do
18
- redis.should_receive(:rpush).twice
19
- queue.enqueue("q", "whatever").should == queue.serialize("whatever")
20
- queue.enqueue("q", {:message => "whatever"}).should == queue.serialize(:message => "whatever")
16
+ it "should enqueue using the passed-in queue name" do
17
+ redis.should_receive(:rpush).with("the_queue", anything)
18
+ queue.enqueue "the_queue", {}
21
19
  end
22
20
 
23
- it "should reject invalid queue names" do
24
- lambda { queue.enqueue(nil, "") }.should raise_error(ArgumentError)
25
- lambda { queue.enqueue("", "") }.should raise_error(ArgumentError)
21
+ it "should accept symbols as queue names, translating to a string" do
22
+ redis.should_receive(:rpush).with("pages_to_crawl", anything)
23
+ queue.enqueue :pages_to_crawl, :url => "http://blog.teksol.info/"
26
24
  end
27
25
 
28
- it "should reject nil messages" do
29
- lambda { queue.enqueue(:a, nil) }.should raise_error(ArgumentError)
26
+ it "should enqueue the encoded message" do
27
+ encoded_message = "jfd9jdf"
28
+
29
+ encoder.should_receive(:encode).and_return(encoded_message)
30
+ redis.should_receive(:rpush).with(anything, encoded_message)
31
+
32
+ queue.enqueue("q", :key => "value")
30
33
  end
31
34
 
32
- it "should allow blank messages (although does this make sense?)" do
35
+ it "should return the encoded message" do
36
+ encoded_message = "barfly123"
37
+ encoder.should_receive(:encode).and_return(encoded_message)
33
38
  redis.should_receive(:rpush)
34
- lambda { queue.enqueue(:a, "") }.should_not raise_error
39
+
40
+ queue.enqueue("q", {:message => "whatever"}).should == encoded_message
35
41
  end
36
42
 
37
- it "accepts symbols as queue names, translating to a string" do
38
- redis.should_receive(:rpush).with("pages_to_crawl", '"http://blog.teksol.info/"')
39
- queue.enqueue :pages_to_crawl, "http://blog.teksol.info/"
43
+ it "should raise an ArgumentError when the message isn't a Hash" do
44
+ lambda { queue.enqueue(:q, 42) }.should raise_error(ArgumentError, "Only hashes are accepted as messages")
45
+ lambda { queue.enqueue(:q, nil) }.should raise_error(ArgumentError, "Only hashes are accepted as messages")
46
+ lambda { queue.enqueue(:q, "") }.should raise_error(ArgumentError, "Only hashes are accepted as messages")
47
+ lambda { queue.enqueue(:q, [1,2,3]) }.should raise_error(ArgumentError, "Only hashes are accepted as messages")
40
48
  end
41
49
 
42
- it "translates the message using JSON before enqueueing" do
43
- redis.should_receive(:rpush).with("ops", '"shutdown_and_destroy"')
44
- queue.enqueue :ops, :shutdown_and_destroy
50
+ it "should reject invalid queue names" do
51
+ lambda { queue.enqueue(nil, "") }.should raise_error(ArgumentError)
52
+ lambda { queue.enqueue("", "") }.should raise_error(ArgumentError)
53
+ end
54
+
55
+ it "should encode the message using the provided encoder" do
56
+ message = {:a => "b"}
57
+ encoded_message = 'hfd0hs'
45
58
 
46
- redis.should_receive(:rpush).with("ops", '[1,2,3]')
47
- queue.enqueue :ops, [1, 2, 3]
59
+ encoder.should_receive(:encode).with(message).and_return(encoded_message)
60
+ redis.should_receive(:rpush)
48
61
 
49
- redis.should_receive(:rpush).with("ops", "{\"hello\":\"world\",\"x\":42}")
50
- queue.enqueue :ops, {:hello => "world", :x => 42}
62
+ queue.enqueue :q, message
51
63
  end
52
64
  end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe SimpleQueues::IdentityEncoder do
4
+ it { should encode(a:1, b:2, c:"3").as(a:1, b:2, c:"3") }
5
+ it { should decode(a:1, b:2, c:"3").as(a:1, b:2, c:"3") }
6
+
7
+ it "should not stringify symbol keys" do
8
+ message = {:a => "b"}
9
+ encoded_message = subject.encode(message)
10
+ decoded_message = subject.decode(encoded_message)
11
+ decoded_message.should == {:a => "b"}
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+
4
+ describe SimpleQueues::JsonEncoder do
5
+ it { should encode("a" => "b").as(JSON("a" => "b")) }
6
+ it { should decode({"a" => "b"}.to_json).as("a" => "b") }
7
+
8
+ it "stringifies Symbol keys" do
9
+ message = {:a => "b"}
10
+ encoded_message = subject.encode(message)
11
+ decoded_message = subject.decode(encoded_message)
12
+ decoded_message.should == {"a" => "b"}
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+ require 'msgpack'
3
+
4
+ describe SimpleQueues::MessagePackEncoder do
5
+ it { should encode("a" => "b").as(MessagePack.pack("a" => "b")) }
6
+ it { should decode({"a" => "b"}.to_msgpack).as("a" => "b") }
7
+
8
+ it "stringifies Symbol keys" do
9
+ message = {:a => "b"}
10
+ encoded_message = subject.encode(message)
11
+ decoded_message = subject.decode(encoded_message)
12
+ decoded_message.should == {"a" => "b"}
13
+ end
14
+ end
@@ -1,32 +1,62 @@
1
1
  require "spec_helper"
2
+ require "redis"
3
+
4
+ describe SimpleQueues::Redis do
5
+ let :queue_name do
6
+ :test
7
+ end
8
+
9
+ let :redis do
10
+ ::Redis.new
11
+ end
2
12
 
3
- describe SimpleQueues::Redis, "enqueue" do
4
13
  let :queue do
5
- SimpleQueues::Redis.new
14
+ SimpleQueues::Redis.new(redis)
6
15
  end
7
16
 
8
17
  before(:each) do
9
- queue.clear(:test)
18
+ redis.flushdb
10
19
  end
11
20
 
12
- it "communicates with Redis as expected" do
13
- obj = {"hello" => 42}
14
- queue.enqueue(:test, obj)
15
- queue.dequeue_with_timeout(:test, 1).should == obj
16
- queue.dequeue_with_timeout(:test, 1).should == nil
17
- end
21
+ context "given an empty queue" do
22
+ context "#size" do
23
+ it { queue.size(queue_name).should == 0 }
24
+ end
25
+
26
+ context "#clear" do
27
+ it { lambda { queue.clear(queue_name) }.should_not raise_error }
28
+ end
18
29
 
19
- it "clears the queue" do
20
- queue.enqueue(:test, :yada => "whatever")
21
- queue.clear(:test)
22
- queue.size(:test).should be_zero
30
+ context "#dequeue_with_timeout" do
31
+ it { queue.dequeue_with_timeout(queue_name, 1).should == nil }
32
+ end
23
33
  end
24
34
 
25
- it "returns the queue size" do
26
- queue.enqueue(:test, 42)
27
- queue.enqueue(:test, 42)
28
- queue.enqueue(:test, 42)
29
- queue.enqueue(:test, 42)
30
- queue.size(:test).should == 4
35
+ context "given a queue with one message" do
36
+ let :message do
37
+ { "value" => Time.now.utc.strftime("%Y-%m-%dT%H:%M:%S") }
38
+ end
39
+
40
+ before(:each) do
41
+ queue.enqueue(queue_name, message)
42
+ end
43
+
44
+ context "#size" do
45
+ it { queue.size(queue_name).should == 1 }
46
+ end
47
+
48
+ context "#dequeue_with_timeout" do
49
+ it { queue.dequeue_with_timeout(queue_name, 1).should == message }
50
+ end
51
+
52
+ context "#clear" do
53
+ before(:each) do
54
+ queue.clear(queue_name)
55
+ end
56
+
57
+ it "should remove all waiting messages" do
58
+ queue.size(queue_name).should == 0
59
+ end
60
+ end
31
61
  end
32
62
  end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ describe SimpleQueues::Redis, "#initialize" do
4
+ it "should default to the JSON encoder" do
5
+ subject.encoder.should be_a(SimpleQueues::JsonEncoder)
6
+ end
7
+
8
+ it "should use the MessagePack encoder when passing :encoder => :messagepack" do
9
+ SimpleQueues::Redis.new(double("redis"), :encoder => :msgpack).encoder.should be_a(SimpleQueues::MessagePackEncoder)
10
+ end
11
+
12
+ it "should use the MessagePack encoder when passing :encoder => :messagepack" do
13
+ SimpleQueues::Redis.new(double("redis"), :encoder => :messagepack).encoder.should be_a(SimpleQueues::MessagePackEncoder)
14
+ end
15
+
16
+ it "should use the Identity encoder when passing :encoder => :identity" do
17
+ SimpleQueues::Redis.new(double("redis"), :encoder => :identity).encoder.should be_a(SimpleQueues::IdentityEncoder)
18
+ end
19
+
20
+ it "should use the JSON encoder when passing :encoder => :json" do
21
+ SimpleQueues::Redis.new(double("redis"), :encoder => :json).encoder.should be_a(SimpleQueues::JsonEncoder)
22
+ end
23
+
24
+ it "should use whatever encoder is sent" do
25
+ encoder = double("encoder", :encode => nil, :decode => nil)
26
+ SimpleQueues::Redis.new(double("redis"), :encoder => encoder).encoder.should be(encoder)
27
+ end
28
+ end
data/spec/spec_helper.rb CHANGED
@@ -1 +1,57 @@
1
1
  require "simple_queues"
2
+
3
+ class DecoderMatcher
4
+ def initialize(message)
5
+ @message = message
6
+ end
7
+
8
+ def as(expected)
9
+ @expected = expected
10
+ self
11
+ end
12
+
13
+ def matches?(decoder)
14
+ @actual = decoder.decode(@message)
15
+ @expected == @actual
16
+ end
17
+
18
+ def failure_message_for_should
19
+ "expected decoded message <#{@actual.inspect} to equal <#{@expected.inspect}>"
20
+ end
21
+
22
+ def description
23
+ "decode #{@message.inspect}"
24
+ end
25
+ end
26
+
27
+ def decode(message)
28
+ DecoderMatcher.new(message)
29
+ end
30
+
31
+ class EncoderMatcher
32
+ def initialize(message)
33
+ @message = message
34
+ end
35
+
36
+ def as(expected)
37
+ @expected = expected
38
+ self
39
+ end
40
+
41
+ def matches?(encoder)
42
+ @actual = encoder.encode(@message)
43
+ @expected == @actual
44
+ end
45
+
46
+ def failure_message_for_should
47
+ "expected encoded message <#{@actual.inspect} to equal <#{@expected.inspect}>"
48
+ end
49
+
50
+ def description
51
+ "encode #{@message.inspect}"
52
+ end
53
+ end
54
+
55
+ def encode(message)
56
+ EncoderMatcher.new(message)
57
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: simple_queues
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.1
5
+ version: 1.2.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Fran\xC3\xA7ois Beausoleil"
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-24 00:00:00 -04:00
13
+ date: 2011-03-25 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -25,7 +25,7 @@ dependencies:
25
25
  type: :runtime
26
26
  version_requirements: *id001
27
27
  - !ruby/object:Gem::Dependency
28
- name: json
28
+ name: rspec
29
29
  prerelease: false
30
30
  requirement: &id002 !ruby/object:Gem::Requirement
31
31
  none: false
@@ -33,10 +33,10 @@ dependencies:
33
33
  - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: "0"
36
- type: :runtime
36
+ type: :development
37
37
  version_requirements: *id002
38
38
  - !ruby/object:Gem::Dependency
39
- name: rspec
39
+ name: yard
40
40
  prerelease: false
41
41
  requirement: &id003 !ruby/object:Gem::Requirement
42
42
  none: false
@@ -47,7 +47,7 @@ dependencies:
47
47
  type: :development
48
48
  version_requirements: *id003
49
49
  - !ruby/object:Gem::Dependency
50
- name: yard
50
+ name: RedCloth
51
51
  prerelease: false
52
52
  requirement: &id004 !ruby/object:Gem::Requirement
53
53
  none: false
@@ -58,7 +58,7 @@ dependencies:
58
58
  type: :development
59
59
  version_requirements: *id004
60
60
  - !ruby/object:Gem::Dependency
61
- name: RedCloth
61
+ name: ruby-debug19
62
62
  prerelease: false
63
63
  requirement: &id005 !ruby/object:Gem::Requirement
64
64
  none: false
@@ -69,7 +69,7 @@ dependencies:
69
69
  type: :development
70
70
  version_requirements: *id005
71
71
  - !ruby/object:Gem::Dependency
72
- name: ruby-debug19
72
+ name: msgpack
73
73
  prerelease: false
74
74
  requirement: &id006 !ruby/object:Gem::Requirement
75
75
  none: false
@@ -79,6 +79,17 @@ dependencies:
79
79
  version: "0"
80
80
  type: :development
81
81
  version_requirements: *id006
82
+ - !ruby/object:Gem::Dependency
83
+ name: json
84
+ prerelease: false
85
+ requirement: &id007 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: "0"
91
+ type: :development
92
+ version_requirements: *id007
82
93
  description: Program to an interface, not an implementation - hides Redis (used as a queue) behind a simple interface
83
94
  email:
84
95
  - francois@teksol.info
@@ -90,6 +101,7 @@ extra_rdoc_files: []
90
101
 
91
102
  files:
92
103
  - .gitignore
104
+ - .rspec
93
105
  - .rvmrc
94
106
  - Gemfile
95
107
  - LICENSE
@@ -97,13 +109,20 @@ files:
97
109
  - Rakefile
98
110
  - autotest/discover.rb
99
111
  - lib/simple_queues.rb
112
+ - lib/simple_queues/encoders/identity.rb
113
+ - lib/simple_queues/encoders/json.rb
114
+ - lib/simple_queues/encoders/message_pack.rb
100
115
  - lib/simple_queues/redis.rb
101
116
  - lib/simple_queues/version.rb
102
117
  - simple_queues.gemspec
103
118
  - spec/dequeueing_spec.rb
104
119
  - spec/enqueueing_spec.rb
120
+ - spec/identity_encoder_spec.rb
121
+ - spec/json_encoder_spec.rb
122
+ - spec/message_pack_encoder_spec.rb
105
123
  - spec/multi_dequeue_spec.rb
106
124
  - spec/redis_integration_spec.rb
125
+ - spec/redis_spec.rb
107
126
  - spec/spec_helper.rb
108
127
  has_rdoc: true
109
128
  homepage: https://github.com/francois/simple_queues
@@ -136,6 +155,10 @@ summary: Simple enqueue/dequeue API for working with queues
136
155
  test_files:
137
156
  - spec/dequeueing_spec.rb
138
157
  - spec/enqueueing_spec.rb
158
+ - spec/identity_encoder_spec.rb
159
+ - spec/json_encoder_spec.rb
160
+ - spec/message_pack_encoder_spec.rb
139
161
  - spec/multi_dequeue_spec.rb
140
162
  - spec/redis_integration_spec.rb
163
+ - spec/redis_spec.rb
141
164
  - spec/spec_helper.rb