@@ -8,13 +8,13 @@ module Concurrent
8
8
9
9
module Executor
10
10
11
- # Submit a task to the thread pool for asynchronous processing.
11
+ # Submit a task to the executor for asynchronous processing.
12
12
#
13
13
# @param [Array] args zero or more arguments to be passed to the task
14
14
#
15
15
# @yield the asynchronous task to perform
16
16
#
17
- # @return [Boolean] `true` if the task is queued, `false` if the thread pool
17
+ # @return [Boolean] `true` if the task is queued, `false` if the executor
18
18
# is not running
19
19
#
20
20
# @raise [ArgumentError] if no task is given
@@ -27,7 +27,7 @@ def post(*args, &task)
27
27
end
28
28
end
29
29
30
- # Submit a task to the thread pool for asynchronous processing.
30
+ # Submit a task to the executor for asynchronous processing.
31
31
#
32
32
# @param [Proc] task the asynchronous task to perform
33
33
#
@@ -37,14 +37,14 @@ def <<(task)
37
37
self
38
38
end
39
39
40
- # Is the thread pool running?
40
+ # Is the executor running?
41
41
#
42
42
# @return [Boolean] `true` when running, `false` when shutting down or shutdown
43
43
def running?
44
44
! @stop_event . set?
45
45
end
46
46
47
- # Is the thread pool shutdown?
47
+ # Is the executor shutdown?
48
48
#
49
49
# @return [Boolean] `true` when shutdown, `false` when shutting down or running
50
50
def shutdown?
@@ -57,7 +57,7 @@ def shutdown
57
57
def kill
58
58
end
59
59
60
- # Block until thread pool shutdown is complete or until `timeout` seconds have
60
+ # Block until executor shutdown is complete or until `timeout` seconds have
61
61
# passed.
62
62
#
63
63
# @note Does not initiate shutdown or termination. Either `shutdown` or `kill`
@@ -89,13 +89,13 @@ def execute(*args, &task)
89
89
90
90
module JavaExecutor
91
91
92
- # Submit a task to the thread pool for asynchronous processing.
92
+ # Submit a task to the executor for asynchronous processing.
93
93
#
94
94
# @param [Array] args zero or more arguments to be passed to the task
95
95
#
96
96
# @yield the asynchronous task to perform
97
97
#
98
- # @return [Boolean] `true` if the task is queued, `false` if the thread pool
98
+ # @return [Boolean] `true` if the task is queued, `false` if the executor
99
99
# is not running
100
100
#
101
101
# @raise [ArgumentError] if no task is given
@@ -111,7 +111,7 @@ def post(*args)
111
111
raise RejectedExecutionError
112
112
end
113
113
114
- # Submit a task to the thread pool for asynchronous processing.
114
+ # Submit a task to the executor for asynchronous processing.
115
115
#
116
116
# @param [Proc] task the asynchronous task to perform
117
117
#
@@ -121,21 +121,21 @@ def <<(task)
121
121
self
122
122
end
123
123
124
- # Is the thread pool running?
124
+ # Is the executor running?
125
125
#
126
126
# @return [Boolean] `true` when running, `false` when shutting down or shutdown
127
127
def running?
128
128
! ( @executor . isShutdown || @executor . isTerminated )
129
129
end
130
130
131
- # Is the thread pool shutdown?
131
+ # Is the executor shutdown?
132
132
#
133
133
# @return [Boolean] `true` when shutdown, `false` when shutting down or running
134
134
def shutdown?
135
135
@executor . isShutdown
136
136
end
137
137
138
- # Block until thread pool shutdown is complete or until `timeout` seconds have
138
+ # Block until executor shutdown is complete or until `timeout` seconds have
139
139
# passed.
140
140
#
141
141
# @note Does not initiate shutdown or termination. Either `shutdown` or `kill`
@@ -150,15 +150,15 @@ def wait_for_termination(timeout)
150
150
151
151
# Begin an orderly shutdown. Tasks already in the queue will be executed,
152
152
# but no new tasks will be accepted. Has no additional effect if the
153
- # thread pool is not running.
153
+ # executor is not running.
154
154
def shutdown
155
155
@executor . shutdown
156
156
return nil
157
157
end
158
158
159
159
# Begin an immediate shutdown. In-progress tasks will be allowed to
160
160
# complete but enqueued tasks will be dismissed and no new tasks
161
- # will be accepted. Has no additional effect if the thread pool is
161
+ # will be accepted. Has no additional effect if the executor is
162
162
# not running.
163
163
def kill
164
164
@executor . shutdownNow
0 commit comments