celluloid-promise 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/celluloid-promise/q.rb +3 -3
- data/lib/celluloid-promise/version.rb +1 -1
- data/spec/promise_spec.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGEzNWUwZjkwZjYyODk0NTJiNTc1M2JhMWY5OGY5MTVhNjJlZDExZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTZiYjk5YzZkOGJlZTRjMTM3NWExYWNjYzA3NmNjNWRkYWYxMzRlYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzU1YTU5NTkzYjlhOGE1ZTg2ZDI1NmZmYWNjZjdiOWFjMTQ1MDJlYWI4NmUx
|
10
|
+
Y2FiYzc1YjNiMjhjNDZlZjQ3YWRhOTFmZTY2MjhmNjlkMjRlMTg3NTg0MjU5
|
11
|
+
MDFlMjFlMWRmZDA3NDk5N2RmNTgzYmExMGQ2ZmY4N2ZhMDViZWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjA4ZWMzYjg1MDJiN2Y0YWI1ZTgzOWJhMDE2Y2NlMzQzOGFlNDc3NjI0MDg1
|
14
|
+
YTgxMmMyODIzZWMxZDU5MGVmYThlZDVmMTMzMmI5ODc2MTYxNWVjMDZlMzk0
|
15
|
+
Njk3OTQwYTlmNjU3MTFlZGZlNzY3ZDk4NmM1NGUzOWZlOWJlN2U=
|
data/lib/celluloid-promise/q.rb
CHANGED
@@ -78,7 +78,7 @@ module Celluloid
|
|
78
78
|
# Schedule as we are touching shared state
|
79
79
|
# Everything else is locally scoped
|
80
80
|
#
|
81
|
-
@reactor.task
|
81
|
+
@reactor.async.task do
|
82
82
|
pending_array = pending
|
83
83
|
|
84
84
|
if pending_array.nil?
|
@@ -122,7 +122,7 @@ module Celluloid
|
|
122
122
|
|
123
123
|
callback ||= blk
|
124
124
|
|
125
|
-
@reactor.task
|
125
|
+
@reactor.async.task do
|
126
126
|
if @error
|
127
127
|
if errback.nil?
|
128
128
|
result.resolve(ResolvedPromise.new(@reactor, @response, true))
|
@@ -164,7 +164,7 @@ module Celluloid
|
|
164
164
|
#
|
165
165
|
# @param [Object] val constant, message or an object representing the result.
|
166
166
|
def resolve(val = nil)
|
167
|
-
@reactor.task
|
167
|
+
@reactor.async.task do
|
168
168
|
if not @pending.nil?
|
169
169
|
callbacks = @pending
|
170
170
|
@pending = nil
|
data/spec/promise_spec.rb
CHANGED
@@ -127,7 +127,7 @@ describe Celluloid::Q do
|
|
127
127
|
it "can modify the result of a promise before returning" do
|
128
128
|
@mutex.synchronize {
|
129
129
|
proc { |name|
|
130
|
-
@defer.task
|
130
|
+
@defer.async.task {
|
131
131
|
@deferred.resolve("Hello #{name}")
|
132
132
|
}
|
133
133
|
@promise.then(proc {|result|
|
@@ -262,9 +262,9 @@ describe Celluloid::Q do
|
|
262
262
|
@finish.call
|
263
263
|
}, @default_fail)
|
264
264
|
|
265
|
-
@defer.task
|
266
|
-
@defer.task
|
267
|
-
@defer.task
|
265
|
+
@defer.async.task { @deferred.resolve(:foo) }
|
266
|
+
@defer.async.task { deferred2.resolve(:baz) }
|
267
|
+
@defer.async.task { deferred1.resolve(:bar) }
|
268
268
|
|
269
269
|
@resource.wait(@mutex)
|
270
270
|
}
|
@@ -281,8 +281,8 @@ describe Celluloid::Q do
|
|
281
281
|
@finish.call
|
282
282
|
})
|
283
283
|
|
284
|
-
@defer.task
|
285
|
-
@defer.task
|
284
|
+
@defer.async.task { @deferred.resolve(:foo) }
|
285
|
+
@defer.async.task { deferred2.reject(:baz) }
|
286
286
|
|
287
287
|
@resource.wait(@mutex)
|
288
288
|
}
|