File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -999,11 +999,16 @@ class InnerPromise < AbstractPromise
999
999
# @abstract
1000
1000
# @!visibility private
1001
1001
class BlockedPromise < InnerPromise
1002
+ def self . new ( *args , &block )
1003
+ promise = super ( *args , &block )
1004
+ promise . blocked_by . each { |f | f . add_callback :pr_callback_notify_blocked , promise }
1005
+ promise
1006
+ end
1007
+
1002
1008
def initialize ( future , blocked_by_futures , countdown )
1003
1009
super ( future )
1004
1010
initialize_blocked_by ( blocked_by_futures )
1005
1011
@Countdown = AtomicFixnum . new countdown
1006
- @BlockedBy . each { |f | f . add_callback :pr_callback_notify_blocked , self }
1007
1012
end
1008
1013
1009
1014
# @api private
@@ -1064,10 +1069,9 @@ def on_completable(done_future)
1064
1069
class BlockedTaskPromise < BlockedPromise
1065
1070
def initialize ( blocked_by_future , default_executor , executor , &task )
1066
1071
raise ArgumentError , 'no block given' unless block_given?
1072
+ super Future . new ( self , default_executor ) , blocked_by_future , 1
1067
1073
@Executor = executor
1068
1074
@Task = task
1069
- # has to be after @Executor and @Task is set
1070
- super Future . new ( self , default_executor ) , blocked_by_future , 1
1071
1075
end
1072
1076
1073
1077
def executor
You can’t perform that action at this time.
0 commit comments