Skip to content

Commit 9538c40

Browse files
committed
Updated yardoc
1 parent b1fd807 commit 9538c40

8 files changed

+33
-29
lines changed

lib/concurrent/executor/executor_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def serialized?
8282
module SerialExecutorService
8383
include ExecutorService
8484

85-
# @!macro executor_module_method_serialized_question
85+
# @!macro executor_service_method_serialized_question
8686
#
8787
# @note Always returns `true`
8888
def serialized?

lib/concurrent/executor/immediate_executor.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,43 @@ def initialize
2121
@stopped = Concurrent::Event.new
2222
end
2323

24-
# @!macro executor_method_post
24+
# @!macro executor_service_method_post
2525
def post(*args, &task)
2626
raise ArgumentError.new('no block given') unless block_given?
2727
return false unless running?
2828
task.call(*args)
2929
true
3030
end
3131

32-
# @!macro executor_method_left_shift
32+
# @!macro executor_service_method_left_shift
3333
def <<(task)
3434
post(&task)
3535
self
3636
end
3737

38-
# @!macro executor_method_running_question
38+
# @!macro executor_service_method_running_question
3939
def running?
4040
! shutdown?
4141
end
4242

43-
# @!macro executor_method_shuttingdown_question
43+
# @!macro executor_service_method_shuttingdown_question
4444
def shuttingdown?
4545
false
4646
end
4747

48-
# @!macro executor_method_shutdown_question
48+
# @!macro executor_service_method_shutdown_question
4949
def shutdown?
5050
@stopped.set?
5151
end
5252

53-
# @!macro executor_method_shutdown
53+
# @!macro executor_service_method_shutdown
5454
def shutdown
5555
@stopped.set
5656
true
5757
end
5858
alias_method :kill, :shutdown
5959

60-
# @!macro executor_method_wait_for_termination
60+
# @!macro executor_service_method_wait_for_termination
6161
def wait_for_termination(timeout = nil)
6262
@stopped.wait(timeout)
6363
end

lib/concurrent/executor/indirect_immediate_executor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def initialize
2323
@internal_executor = SimpleExecutorService.new
2424
end
2525

26-
# @!macro executor_method_post
26+
# @!macro executor_service_method_post
2727
def post(*args, &task)
2828
raise ArgumentError.new("no block given") unless block_given?
2929
return false unless running?

lib/concurrent/executor/java_thread_pool_executor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def initialize(opts = {})
5555
super(opts)
5656
end
5757

58-
# @!macro executor_module_method_can_overflow_question
58+
# @!macro executor_service_method_can_overflow_question
5959
def can_overflow?
6060
@max_queue != 0
6161
end

lib/concurrent/executor/ruby_thread_pool_executor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def initialize(opts = {})
7373
super(opts)
7474
end
7575

76-
# @!macro executor_module_method_can_overflow_question
76+
# @!macro executor_service_method_can_overflow_question
7777
def can_overflow?
7878
synchronize { ns_limited_queue? }
7979
end

lib/concurrent/executor/serialized_execution.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def initialize(executor)
115115
super(executor)
116116
end
117117

118-
# @!macro executor_method_post
118+
# @!macro executor_service_method_post
119119
def post(*args, &task)
120120
raise ArgumentError.new('no block given') unless block_given?
121121
return false unless running?

lib/concurrent/executor/simple_executor_service.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Concurrent
1717
# @note Intended for use primarily in testing and debugging.
1818
class SimpleExecutorService < RubyExecutorService
1919

20-
# @!macro executor_method_post
20+
# @!macro executor_service_method_post
2121
def self.post(*args)
2222
raise ArgumentError.new('no block given') unless block_given?
2323
Thread.new(*args) do
@@ -27,13 +27,13 @@ def self.post(*args)
2727
true
2828
end
2929

30-
# @!macro executor_method_left_shift
30+
# @!macro executor_service_method_left_shift
3131
def self.<<(task)
3232
post(&task)
3333
self
3434
end
3535

36-
# @!macro executor_method_post
36+
# @!macro executor_service_method_post
3737
def post(*args, &task)
3838
raise ArgumentError.new('no block given') unless block_given?
3939
return false unless running?
@@ -49,42 +49,42 @@ def post(*args, &task)
4949
end
5050
end
5151

52-
# @!macro executor_method_left_shift
52+
# @!macro executor_service_method_left_shift
5353
def <<(task)
5454
post(&task)
5555
self
5656
end
5757

58-
# @!macro executor_method_running_question
58+
# @!macro executor_service_method_running_question
5959
def running?
6060
@running.true?
6161
end
6262

63-
# @!macro executor_method_shuttingdown_question
63+
# @!macro executor_service_method_shuttingdown_question
6464
def shuttingdown?
6565
@running.false? && ! @stopped.set?
6666
end
6767

68-
# @!macro executor_method_shutdown_question
68+
# @!macro executor_service_method_shutdown_question
6969
def shutdown?
7070
@stopped.set?
7171
end
7272

73-
# @!macro executor_method_shutdown
73+
# @!macro executor_service_method_shutdown
7474
def shutdown
7575
@running.make_false
7676
@stopped.set if @count.value == 0
7777
true
7878
end
7979

80-
# @!macro executor_method_kill
80+
# @!macro executor_service_method_kill
8181
def kill
8282
@running.make_false
8383
@stopped.set
8484
true
8585
end
8686

87-
# @!macro executor_method_wait_for_termination
87+
# @!macro executor_service_method_wait_for_termination
8888
def wait_for_termination(timeout = nil)
8989
@stopped.wait(timeout)
9090
end

lib/concurrent/executor/timer_set.rb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,10 @@ def post(delay, *args, &task)
6060
true
6161
end
6262

63-
# @!visibility private
64-
def <<(task)
65-
post(0.0, &task)
66-
self
67-
end
68-
69-
# @!macro executor_method_shutdown
63+
# Begin an immediate shutdown. In-progress tasks will be allowed to
64+
# complete but enqueued tasks will be dismissed and no new tasks
65+
# will be accepted. Has no additional effect if the thread pool is
66+
# not running.
7067
def kill
7168
shutdown
7269
end
@@ -162,5 +159,12 @@ def process_tasks
162159
end
163160
end
164161
end
162+
163+
private
164+
165+
def <<(task)
166+
post(0.0, &task)
167+
self
168+
end
165169
end
166170
end

0 commit comments

Comments
 (0)