@@ -106,6 +106,7 @@ def any(*futures)
106
106
# @return [Future]
107
107
def select ( *channels )
108
108
future do
109
+ # noinspection RubyArgCount
109
110
Channel . select do |s |
110
111
channels . each do |ch |
111
112
s . take ( ch ) { |value | [ value , ch ] }
@@ -514,9 +515,9 @@ def apply(block)
514
515
# @!visibility private
515
516
class PartiallyFailed < CompletedWithResult
516
517
def initialize ( value , reason )
518
+ super ( )
517
519
@Value = value
518
520
@Reason = reason
519
- super ( )
520
521
end
521
522
522
523
def success?
@@ -999,10 +1000,9 @@ class InnerPromise < AbstractPromise
999
1000
# @!visibility private
1000
1001
class BlockedPromise < InnerPromise
1001
1002
def initialize ( future , blocked_by_futures , countdown )
1003
+ super ( future )
1002
1004
initialize_blocked_by ( blocked_by_futures )
1003
1005
@Countdown = AtomicFixnum . new countdown
1004
-
1005
- super ( future )
1006
1006
@BlockedBy . each { |f | f . add_callback :pr_callback_notify_blocked , self }
1007
1007
end
1008
1008
@@ -1066,6 +1066,7 @@ def initialize(blocked_by_future, default_executor, executor, &task)
1066
1066
raise ArgumentError , 'no block given' unless block_given?
1067
1067
@Executor = executor
1068
1068
@Task = task
1069
+ # has to be after @Executor and @Task is set
1069
1070
super Future . new ( self , default_executor ) , blocked_by_future , 1
1070
1071
end
1071
1072
@@ -1214,8 +1215,8 @@ def on_completable(done_future)
1214
1215
# @!visibility private
1215
1216
class ZipFutureEventPromise < BlockedPromise
1216
1217
def initialize ( future , event , default_executor )
1217
- @FutureResult = future
1218
1218
super Future . new ( self , default_executor ) , [ future , event ] , 2
1219
+ @FutureResult = future
1219
1220
end
1220
1221
1221
1222
def on_completable ( done_future )
@@ -1226,9 +1227,9 @@ def on_completable(done_future)
1226
1227
# @!visibility private
1227
1228
class ZipFutureFuturePromise < BlockedPromise
1228
1229
def initialize ( future1 , future2 , default_executor )
1230
+ super Future . new ( self , default_executor ) , [ future1 , future2 ] , 2
1229
1231
@Future1Result = future1
1230
1232
@Future2Result = future2
1231
- super Future . new ( self , default_executor ) , [ future1 , future2 ] , 2
1232
1233
end
1233
1234
1234
1235
def on_completable ( done_future )
@@ -1357,8 +1358,8 @@ def touch
1357
1358
private
1358
1359
1359
1360
def initialize ( default_executor , value )
1360
- @Value = value
1361
1361
super Future . new ( self , default_executor )
1362
+ @Value = value
1362
1363
end
1363
1364
end
1364
1365
@@ -1376,6 +1377,8 @@ def inspect
1376
1377
private
1377
1378
1378
1379
def initialize ( default_executor , intended_time )
1380
+ super Event . new ( self , default_executor )
1381
+
1379
1382
@IntendedTime = intended_time
1380
1383
1381
1384
in_seconds = begin
@@ -1388,8 +1391,6 @@ def initialize(default_executor, intended_time)
1388
1391
[ 0 , schedule_time . to_f - now . to_f ] . max
1389
1392
end
1390
1393
1391
- super Event . new ( self , default_executor )
1392
-
1393
1394
Concurrent . global_timer_set . post ( in_seconds ) do
1394
1395
@Future . complete_with Event ::COMPLETED
1395
1396
end
0 commit comments