redismq 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ module RedisMQ
10
10
 
11
11
  def bpop(queue, timeout=0)
12
12
  (queue, message) = redis.blpop(queue_key(queue), timeout)
13
- JSON.parse(message)
13
+ JSON.parse(message, :symbolize_names => true)
14
14
  end
15
15
 
16
16
  def connect_to_redis
@@ -20,7 +20,9 @@ module RedisMQ
20
20
  end
21
21
 
22
22
  def pop(queue)
23
- JSON.parse(redis.lpop(queue_key(queue)))
23
+ result = redis.lpop(queue_key(queue))
24
+ return nil if result.nil?
25
+ JSON.parse(result, :symbolize_names => true)
24
26
  end
25
27
 
26
28
  def publish(topic, payload)
@@ -1,3 +1,3 @@
1
1
  module RedisMQ
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redismq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70208898409520 !ruby/object:Gem::Requirement
16
+ requirement: &70147180623760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70208898409520
24
+ version_requirements: *70147180623760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: redis
27
- requirement: &70208898409020 !ruby/object:Gem::Requirement
27
+ requirement: &70147180623260 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - =
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 2.2.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70208898409020
35
+ version_requirements: *70147180623260
36
36
  description: An implementation of topic exchange using Redis.
37
37
  email:
38
38
  - michael.gorsuch@gmail.com