sidekiq-promise 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8fe996e13d273ffa5bf387826e03ffd70459c18
4
- data.tar.gz: 1dfcffb84b77c3f6a87fe8766ed400c2d49f705f
3
+ metadata.gz: b5559573e9c541f6a3feb79157d5c1ddb91bcbfc
4
+ data.tar.gz: 2ccfb1bd305a828308bf7cf4ac02a5a0a84aab27
5
5
  SHA512:
6
- metadata.gz: 77f93d1654e06bf548b1fe56d3b10405da12e981db7023717440ff0fa7629c3d3f95e3dcfe1b47177481de637815edad676650a5c1eb7ca015b65f9485428f15
7
- data.tar.gz: 6db709578b3a96ecc0872b4ce28e49c9822b136bc7c78e96d4820d6f984c49d21bb45fab06f74b1c1e4ea23219bafdf9ae53ab507273ee4b877160cbdf20c9b4
6
+ metadata.gz: be3f09db0e599160ab08190ebf3c7c3ceedb45194d3fb7a992ddb7226a67bf50a773c5439b843787e8e2d16edc18216b3f50365c88a8d16d2cf805e5a2b6dec5
7
+ data.tar.gz: 6d9b1b7a3756c7adb2667563718d30ebce1437d70e3e9219a17b7ffca729d1fb1a61d951b1b5cfe0d8cea6591898258a1493c317b13a4a29861a3d2e2efb775f
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Promise
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -8,23 +8,11 @@ module Sidekiq
8
8
  @worker_klass = worker_klass
9
9
  @args = args
10
10
 
11
- this = self
12
- block = proc do
13
- this.send :subscribe
14
- end
15
- super block
11
+ super proc { subscribe }
16
12
  end
17
13
 
18
14
  private
19
15
 
20
- def evaluate_promise &block
21
- begin
22
- block.call ::MrDarcy::Promise::DSL.new(self)
23
- rescue Exception => e
24
- reject e
25
- end
26
- end
27
-
28
16
  def subscribe
29
17
  @redis = Sidekiq.redis_pool.checkout
30
18
  @redis.subscribe ::Sidekiq::Promise::Middleware::CHANNEL do |on|
@@ -25,5 +25,5 @@ Gem::Specification.new do |spec|
25
25
  end
26
26
 
27
27
  spec.add_dependency 'sidekiq', '~> 3.0.1'
28
- spec.add_dependency 'mr_darcy', '>= 0.3.0'
28
+ spec.add_dependency 'mr_darcy', '>= 0.4.0'
29
29
  end
@@ -2,8 +2,8 @@ class PromisingValuableWorker
2
2
  include Sidekiq::Promise
3
3
 
4
4
  def perform i
5
- MrDarcy.promise do
6
- resolve i * i
5
+ MrDarcy.promise do |p|
6
+ p.resolve i * i
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-promise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Harton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-07 00:00:00.000000000 Z
11
+ date: 2014-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - '>='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.3.0
145
+ version: 0.4.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '>='
151
151
  - !ruby/object:Gem::Version
152
- version: 0.3.0
152
+ version: 0.4.0
153
153
  description: Treat Sidekiq jobs as asynchronous promises.
154
154
  email:
155
155
  - james@resistor.io