@@ -1049,7 +1049,10 @@ def inspect
1049
1049
private
1050
1050
1051
1051
def initialize_blocked_by ( blocked_by_futures )
1052
- @BlockedBy = [ blocked_by_futures ] . flatten
1052
+ unless blocked_by_futures . is_a? ( ::Array )
1053
+ raise ArgumentError , "has to be array of events/futures: #{ blocked_by_futures . inspect } "
1054
+ end
1055
+ @BlockedBy = blocked_by_futures
1053
1056
end
1054
1057
1055
1058
def clear_blocked_by!
@@ -1076,7 +1079,7 @@ def on_completable(done_future)
1076
1079
class BlockedTaskPromise < BlockedPromise
1077
1080
def initialize ( blocked_by_future , default_executor , executor , args , &task )
1078
1081
raise ArgumentError , 'no block given' unless block_given?
1079
- super Future . new ( self , default_executor ) , blocked_by_future , 1
1082
+ super Future . new ( self , default_executor ) , [ blocked_by_future ] , 1
1080
1083
@Executor = executor
1081
1084
@Task = task
1082
1085
@Args = args
@@ -1255,7 +1258,7 @@ def on_completable(done_future)
1255
1258
1256
1259
class EventWrapperPromise < BlockedPromise
1257
1260
def initialize ( event , default_executor )
1258
- super Event . new ( self , default_executor ) , event , 1
1261
+ super Event . new ( self , default_executor ) , [ event ] , 1
1259
1262
end
1260
1263
1261
1264
def on_completable ( done_future )
@@ -1265,7 +1268,7 @@ def on_completable(done_future)
1265
1268
1266
1269
class FutureWrapperPromise < BlockedPromise
1267
1270
def initialize ( future , default_executor )
1268
- super Future . new ( self , default_executor ) , future , 1
1271
+ super Future . new ( self , default_executor ) , [ future ] , 1
1269
1272
end
1270
1273
1271
1274
def on_completable ( done_future )
0 commit comments