Skip to content

Commit da530a8

Browse files
committed
fix visibility of methods in documentation
1 parent 0210f7a commit da530a8

File tree

1 file changed

+34
-5
lines changed

1 file changed

+34
-5
lines changed

lib/concurrent/edge/promises.rb

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ def any_event_on(default_executor, *futures_and_or_events)
259259
end
260260

261261
module InternalStates
262+
# @private
262263
class State
263264
def completed?
264265
raise NotImplementedError
@@ -271,6 +272,7 @@ def to_sym
271272

272273
private_constant :State
273274

275+
# @private
274276
class Pending < State
275277
def completed?
276278
false
@@ -283,6 +285,7 @@ def to_sym
283285

284286
private_constant :Pending
285287

288+
# @private
286289
class CompletedWithResult < State
287290
def completed?
288291
true
@@ -315,8 +318,9 @@ def apply
315318

316319
private_constant :CompletedWithResult
317320

318-
# @!visibility private
321+
# @private
319322
class Success < CompletedWithResult
323+
320324
def initialize(value)
321325
@Value = value
322326
end
@@ -344,7 +348,7 @@ def to_sym
344348

345349
private_constant :Success
346350

347-
# @!visibility private
351+
# @private
348352
class SuccessArray < Success
349353
def apply(args, block)
350354
block.call(*value, *args)
@@ -353,7 +357,7 @@ def apply(args, block)
353357

354358
private_constant :SuccessArray
355359

356-
# @!visibility private
360+
# @private
357361
class Failed < CompletedWithResult
358362
def initialize(reason)
359363
@Reason = reason
@@ -382,7 +386,7 @@ def apply(args, block)
382386

383387
private_constant :Failed
384388

385-
# @!visibility private
389+
# @private
386390
class PartiallyFailed < CompletedWithResult
387391
def initialize(value, reason)
388392
super()
@@ -421,6 +425,7 @@ def apply(args, block)
421425

422426
private_constant :InternalStates
423427

428+
# Common ancestor of {Event} and {Future} classes
424429
class AbstractEventFuture < Synchronization::Object
425430
safe_initialization!
426431
private(*attr_atomic(:internal_state) - [:internal_state])
@@ -1214,6 +1219,7 @@ def with_hidden_completable
12141219
end
12151220

12161221
# @abstract
1222+
# @private
12171223
class AbstractPromise < Synchronization::Object
12181224
safe_initialization!
12191225
include InternalStates
@@ -1278,16 +1284,20 @@ def initialize(default_executor)
12781284
super CompletableFuture.new(self, default_executor)
12791285
end
12801286

1287+
# @!visibility private
12811288
def succeed(value, raise_on_reassign)
12821289
complete_with Success.new(value), raise_on_reassign
12831290
end
12841291

1292+
# @!visibility private
12851293
def fail(reason, raise_on_reassign)
12861294
complete_with Failed.new(reason), raise_on_reassign
12871295
end
12881296

1297+
# @!visibility private
12891298
public :evaluate_to
12901299

1300+
# @!visibility private
12911301
def evaluate_to!(*args, block)
12921302
evaluate_to(*args, block).wait!
12931303
end
@@ -1299,6 +1309,7 @@ class InnerPromise < AbstractPromise
12991309

13001310
# @abstract
13011311
class BlockedPromise < InnerPromise
1312+
# @!visibility private
13021313
def self.new(*args, &block)
13031314
promise = super(*args, &block)
13041315
promise.blocked_by.each { |f| f.add_callback :callback_notify_blocked, promise }
@@ -1311,7 +1322,7 @@ def initialize(future, blocked_by_futures, countdown)
13111322
@Countdown = AtomicFixnum.new countdown
13121323
end
13131324

1314-
# @api private
1325+
# @!visibility private
13151326
def on_done(future)
13161327
countdown = process_on_done(future)
13171328
completable = completable?(countdown, future)
@@ -1324,6 +1335,7 @@ def on_done(future)
13241335
end
13251336
end
13261337

1338+
# @!visibility private
13271339
def touch
13281340
# TODO (pitr-ch 13-Jun-2016): on construction pass down references of delays to be touched, avoids extra casses
13291341
blocked_by.each(&:touch)
@@ -1335,6 +1347,7 @@ def blocked_by
13351347
@BlockedBy
13361348
end
13371349

1350+
# @!visibility private
13381351
def inspect
13391352
"#{to_s[0..-2]} blocked_by:[#{ blocked_by.map(&:to_s).join(', ')}]>"
13401353
end
@@ -1378,6 +1391,7 @@ def initialize(blocked_by_future, default_executor, executor, args, &task)
13781391
@Args = args
13791392
end
13801393

1394+
# @!visibility private
13811395
def executor
13821396
@Executor
13831397
end
@@ -1579,6 +1593,8 @@ def initialize(event1, event2, default_executor)
15791593
super Event.new(self, default_executor), [event1, event2], 2
15801594
end
15811595

1596+
private
1597+
15821598
def on_completable(done_future)
15831599
complete_with COMPLETED
15841600
end
@@ -1590,6 +1606,8 @@ def initialize(future, event, default_executor)
15901606
@FutureResult = future
15911607
end
15921608

1609+
private
1610+
15931611
def on_completable(done_future)
15941612
complete_with @FutureResult.internal_state
15951613
end
@@ -1602,6 +1620,8 @@ def initialize(future1, future2, default_executor)
16021620
@Future2Result = future2
16031621
end
16041622

1623+
private
1624+
16051625
def on_completable(done_future)
16061626
success1, value1, reason1 = @Future1Result.result
16071627
success2, value2, reason2 = @Future2Result.result
@@ -1620,6 +1640,8 @@ def initialize(event, default_executor)
16201640
super Event.new(self, default_executor), [event], 1
16211641
end
16221642

1643+
private
1644+
16231645
def on_completable(done_future)
16241646
complete_with COMPLETED
16251647
end
@@ -1630,6 +1652,8 @@ def initialize(future, default_executor)
16301652
super Future.new(self, default_executor), [future], 1
16311653
end
16321654

1655+
private
1656+
16331657
def on_completable(done_future)
16341658
complete_with done_future.internal_state
16351659
end
@@ -1684,6 +1708,7 @@ def on_completable(done_future)
16841708

16851709
# @abstract
16861710
class AbstractAnyPromise < BlockedPromise
1711+
# @!visibility private
16871712
def touch
16881713
blocked_by.each(&:touch) unless @Future.completed?
16891714
end
@@ -1735,6 +1760,7 @@ def completable?(countdown, future)
17351760
end
17361761

17371762
class DelayPromise < InnerPromise
1763+
# @!visibility private
17381764
def touch
17391765
@Future.complete_with COMPLETED
17401766
end
@@ -1747,10 +1773,12 @@ def initialize(default_executor)
17471773
end
17481774

17491775
class ScheduledPromise < InnerPromise
1776+
# @!visibility private
17501777
def intended_time
17511778
@IntendedTime
17521779
end
17531780

1781+
# @!visibility private
17541782
def inspect
17551783
"#{to_s[0..-2]} intended_time:[#{@IntendedTime}}>"
17561784
end
@@ -1816,6 +1844,7 @@ def initialize(default_executor, intended_time)
18161844
# TODO try stealing pool, each thread has it's own queue
18171845

18181846
### Experimental features follow
1847+
18191848
module Concurrent
18201849
module Promises
18211850
module FactoryMethods

0 commit comments

Comments
 (0)