@@ -66,7 +66,7 @@ def completable_future
66
66
end
67
67
68
68
# Creates completable future, user is responsible for completing the future once by
69
- # {Promises::CompletableFuture#complete}, {Promises::CompletableFuture#success },
69
+ # {Promises::CompletableFuture#complete}, {Promises::CompletableFuture#succeed },
70
70
# or {Promises::CompletableFuture#fail}
71
71
#
72
72
# @!macro promises.param.default_executor
@@ -95,7 +95,7 @@ def future_on(default_executor, *args, &task)
95
95
ImmediateEventPromise . new ( default_executor ) . future . then ( *args , &task )
96
96
end
97
97
98
- # Creates completed future with will be either success with the given value or failed with
98
+ # Creates completed future with will be either success with the given value or failure with
99
99
# the given reason.
100
100
#
101
101
# @!macro promises.param.default_executor
@@ -108,7 +108,7 @@ def completed_future(success, value, reason, default_executor = :io)
108
108
#
109
109
# @!macro promises.param.default_executor
110
110
# @return [Future]
111
- def succeeded_future ( value , default_executor = :io )
111
+ def successful_future ( value , default_executor = :io )
112
112
completed_future true , value , nil , default_executor
113
113
end
114
114
@@ -821,7 +821,7 @@ def failed?(state = internal_state)
821
821
822
822
# @!macro [new] promises.warn.nil
823
823
# @note Make sure returned `nil` is not confused with timeout, no value when failed,
824
- # no reason when success , etc.
824
+ # no reason when successful , etc.
825
825
# Use more exact methods if needed, like {#wait}, {#value!}, {#result}, etc.
826
826
827
827
# @!macro [new] promises.method.value
@@ -831,7 +831,7 @@ def failed?(state = internal_state)
831
831
# @!macro promises.warn.blocks
832
832
# @!macro promises.warn.nil
833
833
# @!macro promises.param.timeout
834
- # @return [Object, nil] the value of the Future when success , nil on timeout or failure.
834
+ # @return [Object, nil] the value of the Future when successful , nil on timeout or failure.
835
835
def value ( timeout = nil )
836
836
touch
837
837
internal_state . value if wait_until_complete timeout
@@ -854,7 +854,7 @@ def reason(timeout = nil)
854
854
#
855
855
# @!macro promises.warn.blocks
856
856
# @!macro promises.param.timeout
857
- # @return [Array(Boolean, Object, Exception), nil] triplet of success, value, reason, or nil
857
+ # @return [Array(Boolean, Object, Exception), nil] triplet of success? , value, reason, or nil
858
858
# on timeout.
859
859
def result ( timeout = nil )
860
860
touch
@@ -870,7 +870,7 @@ def wait!(timeout = nil)
870
870
end
871
871
872
872
# @!macro promises.method.value
873
- # @return [Object, nil] the value of the Future when success , nil on timeout.
873
+ # @return [Object, nil] the value of the Future when successful , nil on timeout.
874
874
# @raise [Exception] {#reason} on failure
875
875
def value! ( timeout = nil )
876
876
touch
@@ -1173,8 +1173,8 @@ def complete(success, value, reason, raise_on_reassign = true)
1173
1173
# which triggers all dependent futures.
1174
1174
#
1175
1175
# @!macro promise.param.raise_on_reassign
1176
- def success ( value , raise_on_reassign = true )
1177
- promise . success ( value , raise_on_reassign )
1176
+ def succeed ( value , raise_on_reassign = true )
1177
+ promise . succeed ( value , raise_on_reassign )
1178
1178
end
1179
1179
1180
1180
# Makes the future failed with `reason`,
@@ -1278,7 +1278,7 @@ def initialize(default_executor)
1278
1278
super CompletableFuture . new ( self , default_executor )
1279
1279
end
1280
1280
1281
- def success ( value , raise_on_reassign )
1281
+ def succeed ( value , raise_on_reassign )
1282
1282
complete_with Success . new ( value ) , raise_on_reassign
1283
1283
end
1284
1284
@@ -1325,7 +1325,7 @@ def on_done(future)
1325
1325
end
1326
1326
1327
1327
def touch
1328
- # TODO (pitr-ch 13-Jun-2016): track if it has lazy parent if it's needed avoids CASes!
1328
+ # TODO (pitr-ch 13-Jun-2016): on construction pass down references of delays to be touched, avoids extra casses
1329
1329
blocked_by . each ( &:touch )
1330
1330
end
1331
1331
@@ -1964,7 +1964,7 @@ class Throttle < Synchronization::Object
1964
1964
def initialize ( max )
1965
1965
super ( )
1966
1966
self . can_run = max
1967
- # TODO (pitr-ch 10-Jun-2016): lockfree gueue is needed
1967
+ # TODO (pitr-ch 10-Jun-2016): lock-free queue is needed
1968
1968
@Queue = Queue . new
1969
1969
end
1970
1970
0 commit comments