Update doc
This commit is contained in:
parent
8f83e4a25e
commit
082c05f136
4
Rakefile
4
Rakefile
|
@ -176,7 +176,9 @@ begin
|
|||
'LICENSE.md',
|
||||
'CHANGELOG.md']
|
||||
end
|
||||
Rake::Task[name].prerequisites.push removal_name, 'yard:eval_md', 'yard:update_readme'
|
||||
Rake::Task[name].prerequisites.push removal_name,
|
||||
# 'yard:eval_md',
|
||||
'yard:update_readme'
|
||||
end
|
||||
|
||||
define_yard_task.call current_yard_version_name
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -143,9 +143,7 @@ implementation. <code><id></code> is uniq for each thread.</li>
|
|||
<li><code>max_queue</code>: The maximum number of tasks that may be waiting in the work queue at
|
||||
any one time. When the queue size reaches <code>max_queue</code> and no new threads can be created,
|
||||
subsequent tasks will be rejected in accordance with the configured <code>fallback_policy</code>.</li>
|
||||
<li><code>auto_terminate</code>: When true (default) an <code>at_exit</code> handler will be registered which
|
||||
will stop the thread pool when the application exits. See below for more information
|
||||
on shutting down thread pools.</li>
|
||||
<li><code>auto_terminate</code>: When true (default), the threads started will be marked as daemon.</li>
|
||||
<li><code>fallback_policy</code>: The policy defining how rejected tasks are handled.</li>
|
||||
</ul>
|
||||
|
||||
|
@ -175,15 +173,11 @@ the orderly shutdown to complete</li>
|
|||
|
||||
<p>On some runtime platforms (most notably the JVM) the application will not
|
||||
exit until all thread pools have been shutdown. To prevent applications from
|
||||
"hanging" on exit all thread pools include an <code>at_exit</code> handler that will
|
||||
stop the thread pool when the application exits. This handler uses a brute
|
||||
force method to stop the pool and makes no guarantees regarding resources being
|
||||
used by any tasks still running. Registration of this <code>at_exit</code> handler can be
|
||||
prevented by setting the thread pool's constructor <code>:auto_terminate</code> option to
|
||||
<code>false</code> when the thread pool is created. All thread pools support this option.</p>
|
||||
"hanging" on exit, all threads can be marked as daemon according to the
|
||||
<code>:auto_terminate</code> option.</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># an `at_exit` handler will be registered
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># prevent `at_exit` handler registration
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># threads will be marked as daemon
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># mark threads as non-daemon
|
||||
</span></code></pre>
|
||||
|
||||
|
||||
|
@ -201,7 +195,7 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
|
||||
<li><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html" target="_parent" title="Java ExecutorService interface">Java ExecutorService interface</a></li>
|
||||
|
||||
<li><a href="http://ruby-doc.org//core-2.2.0/Kernel.html#method-i-at_exit" target="_parent" title="Kernel#at_exit">Kernel#at_exit</a></li>
|
||||
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-" target="_parent" title="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-">https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -498,7 +498,7 @@ or be even more defensive and terminate.</li>
|
|||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#spawn-class_method" title="#spawn (class method)">.<strong>spawn</strong>(*args, &body) ⇒ Pid </a>
|
||||
<a href="#spawn-class_method" title="#spawn (class method)">.<strong>spawn</strong>(*args, **kwargs, &body) ⇒ Pid </a>
|
||||
|
||||
|
||||
|
||||
|
@ -718,7 +718,7 @@ may be shared by other abstractions</p>
|
|||
<div class="method_details ">
|
||||
<h3 class="signature " id="spawn-class_method">
|
||||
|
||||
.<strong>spawn</strong>(*args, &body) ⇒ <tt><span class='object_link'><a href="ErlangActor/Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>
|
||||
.<strong>spawn</strong>(*args, **kwargs, &body) ⇒ <tt><span class='object_link'><a href="ErlangActor/Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#spawn-instance_method" title="#spawn (instance method)">#<strong>spawn</strong>(*args, &body) ⇒ Pid </a>
|
||||
<a href="#spawn-instance_method" title="#spawn (instance method)">#<strong>spawn</strong>(*args, **kwargs, &body) ⇒ Pid </a>
|
||||
|
||||
|
||||
|
||||
|
@ -171,7 +171,7 @@
|
|||
<div class="method_details first">
|
||||
<h3 class="signature first" id="spawn-instance_method">
|
||||
|
||||
#<strong>spawn</strong>(*args, &body) ⇒ <tt><span class='object_link'><a href="Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>
|
||||
#<strong>spawn</strong>(*args, **kwargs, &body) ⇒ <tt><span class='object_link'><a href="Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>
|
||||
|
||||
|
||||
|
||||
|
@ -213,8 +213,8 @@
|
|||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/concurrent-ruby-edge/concurrent/edge/erlang_actor.rb', line 534</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_spawn'>spawn</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_spawn_actor'>spawn_actor</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_spawn'>spawn</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_spawn_actor'>spawn_actor</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -131,9 +131,7 @@ implementation. <code><id></code> is uniq for each thread.</li>
|
|||
<li><code>max_queue</code>: The maximum number of tasks that may be waiting in the work queue at
|
||||
any one time. When the queue size reaches <code>max_queue</code> and no new threads can be created,
|
||||
subsequent tasks will be rejected in accordance with the configured <code>fallback_policy</code>.</li>
|
||||
<li><code>auto_terminate</code>: When true (default) an <code>at_exit</code> handler will be registered which
|
||||
will stop the thread pool when the application exits. See below for more information
|
||||
on shutting down thread pools.</li>
|
||||
<li><code>auto_terminate</code>: When true (default), the threads started will be marked as daemon.</li>
|
||||
<li><code>fallback_policy</code>: The policy defining how rejected tasks are handled.</li>
|
||||
</ul>
|
||||
|
||||
|
@ -163,15 +161,11 @@ the orderly shutdown to complete</li>
|
|||
|
||||
<p>On some runtime platforms (most notably the JVM) the application will not
|
||||
exit until all thread pools have been shutdown. To prevent applications from
|
||||
"hanging" on exit all thread pools include an <code>at_exit</code> handler that will
|
||||
stop the thread pool when the application exits. This handler uses a brute
|
||||
force method to stop the pool and makes no guarantees regarding resources being
|
||||
used by any tasks still running. Registration of this <code>at_exit</code> handler can be
|
||||
prevented by setting the thread pool's constructor <code>:auto_terminate</code> option to
|
||||
<code>false</code> when the thread pool is created. All thread pools support this option.</p>
|
||||
"hanging" on exit, all threads can be marked as daemon according to the
|
||||
<code>:auto_terminate</code> option.</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'>FixedThreadPool</span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># an `at_exit` handler will be registered
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'>FixedThreadPool</span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># prevent `at_exit` handler registration
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'>FixedThreadPool</span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># threads will be marked as daemon
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'>FixedThreadPool</span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># mark threads as non-daemon
|
||||
</span></code></pre>
|
||||
|
||||
|
||||
|
@ -189,7 +183,7 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
|
||||
<li><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html" target="_parent" title="Java ExecutorService interface">Java ExecutorService interface</a></li>
|
||||
|
||||
<li><a href="http://ruby-doc.org//core-2.2.0/Kernel.html#method-i-at_exit" target="_parent" title="Kernel#at_exit">Kernel#at_exit</a></li>
|
||||
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-" target="_parent" title="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-">https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -365,17 +359,17 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
<pre class="lines">
|
||||
|
||||
|
||||
194
|
||||
195
|
||||
196
|
||||
197
|
||||
198
|
||||
199
|
||||
200
|
||||
201
|
||||
202
|
||||
203
|
||||
204
|
||||
205
|
||||
206
|
||||
207</pre>
|
||||
201</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb', line 200</span>
|
||||
<pre class="code"><span class="info file"># File 'lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb', line 194</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_num_threads'>num_threads</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>number of threads must be greater than zero</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_num_threads'>num_threads</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'><</span> <span class='int'>1</span>
|
||||
|
|
|
@ -348,6 +348,8 @@ during testing because it makes all operations deterministic.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
|
|
|
@ -212,6 +212,8 @@ inconsistent with how it would behave for a threaded executor.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
|
|
|
@ -400,6 +400,8 @@ lead to suboptimal performance.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
|
|
@ -194,7 +194,7 @@ automatically be restarted.</p>
|
|||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<li class="public deprecated">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#auto_terminate=-instance_method" title="#auto_terminate= (instance method)">#<strong>auto_terminate=</strong>(value) ⇒ Boolean </a>
|
||||
|
@ -207,11 +207,11 @@ automatically be restarted.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
<span class="deprecated note title">deprecated</span>
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'><p>Set the auto-terminate behavior for this executor.</p>
|
||||
<span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'><p>Has no effect</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
@ -675,7 +675,9 @@ automatically be restarted.</p>
|
|||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p>Set the auto-terminate behavior for this executor.</p>
|
||||
<div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'><p>Has no effect</p>
|
||||
</div></div>
|
||||
<p>Set the auto-terminate behavior for this executor.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
|
|
@ -155,9 +155,7 @@ implementation. <code><id></code> is uniq for each thread.</li>
|
|||
<li><code>max_queue</code>: The maximum number of tasks that may be waiting in the work queue at
|
||||
any one time. When the queue size reaches <code>max_queue</code> and no new threads can be created,
|
||||
subsequent tasks will be rejected in accordance with the configured <code>fallback_policy</code>.</li>
|
||||
<li><code>auto_terminate</code>: When true (default) an <code>at_exit</code> handler will be registered which
|
||||
will stop the thread pool when the application exits. See below for more information
|
||||
on shutting down thread pools.</li>
|
||||
<li><code>auto_terminate</code>: When true (default), the threads started will be marked as daemon.</li>
|
||||
<li><code>fallback_policy</code>: The policy defining how rejected tasks are handled.</li>
|
||||
</ul>
|
||||
|
||||
|
@ -187,15 +185,11 @@ the orderly shutdown to complete</li>
|
|||
|
||||
<p>On some runtime platforms (most notably the JVM) the application will not
|
||||
exit until all thread pools have been shutdown. To prevent applications from
|
||||
"hanging" on exit all thread pools include an <code>at_exit</code> handler that will
|
||||
stop the thread pool when the application exits. This handler uses a brute
|
||||
force method to stop the pool and makes no guarantees regarding resources being
|
||||
used by any tasks still running. Registration of this <code>at_exit</code> handler can be
|
||||
prevented by setting the thread pool's constructor <code>:auto_terminate</code> option to
|
||||
<code>false</code> when the thread pool is created. All thread pools support this option.</p>
|
||||
"hanging" on exit, all threads can be marked as daemon according to the
|
||||
<code>:auto_terminate</code> option.</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># an `at_exit` handler will be registered
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># prevent `at_exit` handler registration
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># threads will be marked as daemon
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># mark threads as non-daemon
|
||||
</span></code></pre>
|
||||
|
||||
|
||||
|
@ -213,7 +207,7 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
|
||||
<li><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html" target="_parent" title="Java ExecutorService interface">Java ExecutorService interface</a></li>
|
||||
|
||||
<li><a href="http://ruby-doc.org//core-2.2.0/Kernel.html#method-i-at_exit" target="_parent" title="Kernel#at_exit">Kernel#at_exit</a></li>
|
||||
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-" target="_parent" title="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-">https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -572,7 +566,7 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<li class="public deprecated">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#auto_terminate=-instance_method" title="#auto_terminate= (instance method)">#<strong>auto_terminate=</strong>(value) ⇒ Boolean </a>
|
||||
|
@ -585,11 +579,11 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
|
||||
|
||||
|
||||
|
||||
<span class="deprecated note title">deprecated</span>
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'><p>Set the auto-terminate behavior for this executor.</p>
|
||||
<span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'><p>Has no effect</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
@ -2253,7 +2247,9 @@ new tasks. A value of -1 indicates that the queue may grow without bound.</p>
|
|||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p>Set the auto-terminate behavior for this executor.</p>
|
||||
<div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'><p>Has no effect</p>
|
||||
</div></div>
|
||||
<p>Set the auto-terminate behavior for this executor.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
|
|
@ -246,6 +246,8 @@ Each task is represented as a <code>ScheduledTask</code>.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
|
|
|
@ -732,6 +732,8 @@ or Haskell) as we are likely to get in Ruby.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
|
|
|
@ -59,18 +59,28 @@
|
|||
|
||||
<div id="content"><div id='filecontents'><h2>Current</h2>
|
||||
|
||||
<h2>Release v1.1.6, edge v0.6.0 (10 Feb 2020)</h2>
|
||||
|
||||
<p>concurrent-ruby:</p>
|
||||
|
||||
<ul>
|
||||
<li>(#841) Concurrent.disable_at_exit_handlers! is no longer needed and was deprecated.</li>
|
||||
<li>(#841) AbstractExecutorService#auto_terminate= was deprecated and has no effect.
|
||||
Set :auto_terminate option instead when executor is initialized.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Release v1.1.6.pre1, edge v0.6.0.pre1 (26 Jan 2020)</h2>
|
||||
|
||||
<p>concurrent-ruby:</p>
|
||||
|
||||
<ul>
|
||||
<li>Allow to name executors, the name is also used to name their threads (#828)</li>
|
||||
<li>Implement #dup and #clone for structs (#838)</li>
|
||||
<li>Safer finalizers for thread local variables (#821)</li>
|
||||
<li>(#828) Allow to name executors, the name is also used to name their threads </li>
|
||||
<li>(#838) Implement #dup and #clone for structs</li>
|
||||
<li>(#821) Safer finalizers for thread local variables</li>
|
||||
<li>Documentation fixes</li>
|
||||
<li>Use Ruby's Etc.nprocessors if available (#814)</li>
|
||||
<li>Fix directory structure not to mess with packaging tools (#812)</li>
|
||||
<li>Fix termination of pools on JRuby (#840)</li>
|
||||
<li>(#814) Use Ruby's Etc.nprocessors if available</li>
|
||||
<li>(#812) Fix directory structure not to mess with packaging tools</li>
|
||||
<li>(#840) Fix termination of pools on JRuby</li>
|
||||
</ul>
|
||||
|
||||
<p>concurrent-ruby-edge:</p>
|
||||
|
|
|
@ -708,7 +708,7 @@
|
|||
</li>
|
||||
|
||||
|
||||
<li class="even ">
|
||||
<li class="even deprecated">
|
||||
<div class="item">
|
||||
<span class='object_link'><a href="Concurrent/SingleThreadExecutor.html#auto_terminate=-instance_method" title="Concurrent::SingleThreadExecutor#auto_terminate= (method)">#auto_terminate=</a></span>
|
||||
<small>Concurrent::SingleThreadExecutor</small>
|
||||
|
@ -716,7 +716,7 @@
|
|||
</li>
|
||||
|
||||
|
||||
<li class="odd ">
|
||||
<li class="odd deprecated">
|
||||
<div class="item">
|
||||
<span class='object_link'><a href="Concurrent/ThreadPoolExecutor.html#auto_terminate=-instance_method" title="Concurrent::ThreadPoolExecutor#auto_terminate= (method)">#auto_terminate=</a></span>
|
||||
<small>Concurrent::ThreadPoolExecutor</small>
|
||||
|
@ -1692,7 +1692,7 @@
|
|||
</li>
|
||||
|
||||
|
||||
<li class="odd ">
|
||||
<li class="odd deprecated">
|
||||
<div class="item">
|
||||
<span class='object_link'><a href="Concurrent.html#disable_at_exit_handlers!-class_method" title="Concurrent.disable_at_exit_handlers! (method)">disable_at_exit_handlers!</a></span>
|
||||
<small>Concurrent</small>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -143,9 +143,7 @@ implementation. <code><id></code> is uniq for each thread.</li>
|
|||
<li><code>max_queue</code>: The maximum number of tasks that may be waiting in the work queue at
|
||||
any one time. When the queue size reaches <code>max_queue</code> and no new threads can be created,
|
||||
subsequent tasks will be rejected in accordance with the configured <code>fallback_policy</code>.</li>
|
||||
<li><code>auto_terminate</code>: When true (default) an <code>at_exit</code> handler will be registered which
|
||||
will stop the thread pool when the application exits. See below for more information
|
||||
on shutting down thread pools.</li>
|
||||
<li><code>auto_terminate</code>: When true (default), the threads started will be marked as daemon.</li>
|
||||
<li><code>fallback_policy</code>: The policy defining how rejected tasks are handled.</li>
|
||||
</ul>
|
||||
|
||||
|
@ -175,15 +173,11 @@ the orderly shutdown to complete</li>
|
|||
|
||||
<p>On some runtime platforms (most notably the JVM) the application will not
|
||||
exit until all thread pools have been shutdown. To prevent applications from
|
||||
"hanging" on exit all thread pools include an <code>at_exit</code> handler that will
|
||||
stop the thread pool when the application exits. This handler uses a brute
|
||||
force method to stop the pool and makes no guarantees regarding resources being
|
||||
used by any tasks still running. Registration of this <code>at_exit</code> handler can be
|
||||
prevented by setting the thread pool's constructor <code>:auto_terminate</code> option to
|
||||
<code>false</code> when the thread pool is created. All thread pools support this option.</p>
|
||||
"hanging" on exit, all threads can be marked as daemon according to the
|
||||
<code>:auto_terminate</code> option.</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># an `at_exit` handler will be registered
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># prevent `at_exit` handler registration
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># threads will be marked as daemon
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># mark threads as non-daemon
|
||||
</span></code></pre>
|
||||
|
||||
|
||||
|
@ -201,7 +195,7 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
|
||||
<li><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html" target="_parent" title="Java ExecutorService interface">Java ExecutorService interface</a></li>
|
||||
|
||||
<li><a href="http://ruby-doc.org//core-2.2.0/Kernel.html#method-i-at_exit" target="_parent" title="Kernel#at_exit">Kernel#at_exit</a></li>
|
||||
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-" target="_parent" title="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-">https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -498,7 +498,7 @@ or be even more defensive and terminate.</li>
|
|||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#spawn-class_method" title="#spawn (class method)">.<strong>spawn</strong>(*args, &body) ⇒ Pid </a>
|
||||
<a href="#spawn-class_method" title="#spawn (class method)">.<strong>spawn</strong>(*args, **kwargs, &body) ⇒ Pid </a>
|
||||
|
||||
|
||||
|
||||
|
@ -718,7 +718,7 @@ may be shared by other abstractions</p>
|
|||
<div class="method_details ">
|
||||
<h3 class="signature " id="spawn-class_method">
|
||||
|
||||
.<strong>spawn</strong>(*args, &body) ⇒ <tt><span class='object_link'><a href="ErlangActor/Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>
|
||||
.<strong>spawn</strong>(*args, **kwargs, &body) ⇒ <tt><span class='object_link'><a href="ErlangActor/Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#spawn-instance_method" title="#spawn (instance method)">#<strong>spawn</strong>(*args, &body) ⇒ Pid </a>
|
||||
<a href="#spawn-instance_method" title="#spawn (instance method)">#<strong>spawn</strong>(*args, **kwargs, &body) ⇒ Pid </a>
|
||||
|
||||
|
||||
|
||||
|
@ -171,7 +171,7 @@
|
|||
<div class="method_details first">
|
||||
<h3 class="signature first" id="spawn-instance_method">
|
||||
|
||||
#<strong>spawn</strong>(*args, &body) ⇒ <tt><span class='object_link'><a href="Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>
|
||||
#<strong>spawn</strong>(*args, **kwargs, &body) ⇒ <tt><span class='object_link'><a href="Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>
|
||||
|
||||
|
||||
|
||||
|
@ -213,8 +213,8 @@
|
|||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/concurrent-ruby-edge/concurrent/edge/erlang_actor.rb', line 534</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_spawn'>spawn</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_spawn_actor'>spawn_actor</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_spawn'>spawn</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_spawn_actor'>spawn_actor</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -131,9 +131,7 @@ implementation. <code><id></code> is uniq for each thread.</li>
|
|||
<li><code>max_queue</code>: The maximum number of tasks that may be waiting in the work queue at
|
||||
any one time. When the queue size reaches <code>max_queue</code> and no new threads can be created,
|
||||
subsequent tasks will be rejected in accordance with the configured <code>fallback_policy</code>.</li>
|
||||
<li><code>auto_terminate</code>: When true (default) an <code>at_exit</code> handler will be registered which
|
||||
will stop the thread pool when the application exits. See below for more information
|
||||
on shutting down thread pools.</li>
|
||||
<li><code>auto_terminate</code>: When true (default), the threads started will be marked as daemon.</li>
|
||||
<li><code>fallback_policy</code>: The policy defining how rejected tasks are handled.</li>
|
||||
</ul>
|
||||
|
||||
|
@ -163,15 +161,11 @@ the orderly shutdown to complete</li>
|
|||
|
||||
<p>On some runtime platforms (most notably the JVM) the application will not
|
||||
exit until all thread pools have been shutdown. To prevent applications from
|
||||
"hanging" on exit all thread pools include an <code>at_exit</code> handler that will
|
||||
stop the thread pool when the application exits. This handler uses a brute
|
||||
force method to stop the pool and makes no guarantees regarding resources being
|
||||
used by any tasks still running. Registration of this <code>at_exit</code> handler can be
|
||||
prevented by setting the thread pool's constructor <code>:auto_terminate</code> option to
|
||||
<code>false</code> when the thread pool is created. All thread pools support this option.</p>
|
||||
"hanging" on exit, all threads can be marked as daemon according to the
|
||||
<code>:auto_terminate</code> option.</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'>FixedThreadPool</span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># an `at_exit` handler will be registered
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'>FixedThreadPool</span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># prevent `at_exit` handler registration
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'>FixedThreadPool</span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># threads will be marked as daemon
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'>FixedThreadPool</span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># mark threads as non-daemon
|
||||
</span></code></pre>
|
||||
|
||||
|
||||
|
@ -189,7 +183,7 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
|
||||
<li><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html" target="_parent" title="Java ExecutorService interface">Java ExecutorService interface</a></li>
|
||||
|
||||
<li><a href="http://ruby-doc.org//core-2.2.0/Kernel.html#method-i-at_exit" target="_parent" title="Kernel#at_exit">Kernel#at_exit</a></li>
|
||||
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-" target="_parent" title="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-">https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -365,17 +359,17 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
<pre class="lines">
|
||||
|
||||
|
||||
194
|
||||
195
|
||||
196
|
||||
197
|
||||
198
|
||||
199
|
||||
200
|
||||
201
|
||||
202
|
||||
203
|
||||
204
|
||||
205
|
||||
206
|
||||
207</pre>
|
||||
201</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb', line 200</span>
|
||||
<pre class="code"><span class="info file"># File 'lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb', line 194</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_num_threads'>num_threads</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>number of threads must be greater than zero</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_num_threads'>num_threads</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'><</span> <span class='int'>1</span>
|
||||
|
|
|
@ -348,6 +348,8 @@ during testing because it makes all operations deterministic.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
|
|
|
@ -212,6 +212,8 @@ inconsistent with how it would behave for a threaded executor.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ since the channel is full. </p>
|
|||
|
||||
<p>When message is popped the last thread continues and finishes as well.</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_ch'>ch</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span> <span class='comment'># => {:message=>0}
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_ch'>ch</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span> <span class='comment'># => {:message=>1}
|
||||
</span><span class='id identifier rubyid_threads'>threads</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:join</span><span class='rparen'>)</span>
|
||||
<span class='comment'># => [#<Thread:0x000003@channel.in.md:14 dead>,
|
||||
</span><span class='comment'># #<Thread:0x000004@channel.in.md:14 dead>,
|
||||
|
@ -169,7 +169,7 @@ one will be blocked until new messages is pushed.</p>
|
|||
</span><span class='id identifier rubyid_ch'>ch</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='label'>message:</span> <span class='int'>3</span>
|
||||
<span class='comment'># => #<Concurrent::Promises::Channel:0x000002 capacity taken 0 of 2>
|
||||
</span><span class='id identifier rubyid_threads'>threads</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:value</span><span class='rparen'>)</span>
|
||||
<span class='comment'># => [{:message=>1}, {:message=>2}, {:message=>3}]
|
||||
<span class='comment'># => [{:message=>0}, {:message=>2}, {:message=>3}]
|
||||
</span></code></pre>
|
||||
|
||||
<h3>Promises integration</h3>
|
||||
|
@ -325,14 +325,14 @@ if the consumers are not keeping up.</p>
|
|||
</span><span class='comment'># "producer 1 pushing 0",
|
||||
</span><span class='comment'># "consumer 0 got 0. payload 0 from producer 0",
|
||||
</span><span class='comment'># "producer 0 pushing 3",
|
||||
</span><span class='comment'># "consumer 2 got 0. payload 1 from producer 0",
|
||||
</span><span class='comment'># "consumer 1 got 0. payload 1 from producer 0",
|
||||
</span><span class='comment'># "consumer 2 got 0. payload 2 from producer 0",
|
||||
</span><span class='comment'># "consumer 3 got 0. payload 0 from producer 1",
|
||||
</span><span class='comment'># "producer 1 pushing 1",
|
||||
</span><span class='comment'># "consumer 3 got 0. payload 2 from producer 0",
|
||||
</span><span class='comment'># "consumer 1 got 0. payload 0 from producer 1",
|
||||
</span><span class='comment'># "producer 1 pushing 2",
|
||||
</span><span class='comment'># "consumer 2 got 1. payload 3 from producer 0",
|
||||
</span><span class='comment'># "consumer 1 got 1. payload 1 from producer 1",
|
||||
</span><span class='comment'># "consumer 1 got 1. payload 3 from producer 0",
|
||||
</span><span class='comment'># "producer 1 pushing 3",
|
||||
</span><span class='comment'># "consumer 2 got 1. payload 1 from producer 1",
|
||||
</span><span class='comment'># "consumer 3 got 1. payload 2 from producer 1",
|
||||
</span><span class='comment'># "consumer 0 got 1. payload 3 from producer 1"]
|
||||
</span></code></pre>
|
||||
|
@ -387,21 +387,21 @@ that run a thread pool.</p>
|
|||
</span><span class='comment'># investigate log
|
||||
</span><span class='id identifier rubyid_log'>log</span>
|
||||
<span class='comment'># => ["producer 0 pushing 0",
|
||||
</span><span class='comment'># "producer 1 pushing 0",
|
||||
</span><span class='comment'># "producer 1 pushing 1",
|
||||
</span><span class='comment'># "consumer 1 got 0. payload 0 from producer 1",
|
||||
</span><span class='comment'># "consumer 2 got 0. payload 1 from producer 1",
|
||||
</span><span class='comment'># "producer 0 pushing 1",
|
||||
</span><span class='comment'># "producer 0 pushing 2",
|
||||
</span><span class='comment'># "producer 1 pushing 0",
|
||||
</span><span class='comment'># "consumer 1 got 0. payload 1 from producer 0",
|
||||
</span><span class='comment'># "producer 0 pushing 3",
|
||||
</span><span class='comment'># "consumer 0 got 0. payload 0 from producer 0",
|
||||
</span><span class='comment'># "producer 1 pushing 1",
|
||||
</span><span class='comment'># "consumer 2 got 0. payload 2 from producer 0",
|
||||
</span><span class='comment'># "consumer 3 got 0. payload 0 from producer 1",
|
||||
</span><span class='comment'># "producer 1 pushing 2",
|
||||
</span><span class='comment'># "consumer 3 got 1. payload 1 from producer 1",
|
||||
</span><span class='comment'># "consumer 0 got 0. payload 0 from producer 0",
|
||||
</span><span class='comment'># "consumer 3 got 0. payload 1 from producer 0",
|
||||
</span><span class='comment'># "producer 1 pushing 3",
|
||||
</span><span class='comment'># "consumer 2 got 1. payload 2 from producer 0",
|
||||
</span><span class='comment'># "consumer 1 got 1. payload 3 from producer 0",
|
||||
</span><span class='comment'># "consumer 0 got 1. payload 2 from producer 1",
|
||||
</span><span class='comment'># "consumer 2 got 1. payload 3 from producer 1"]
|
||||
</span><span class='comment'># "consumer 3 got 1. payload 3 from producer 1",
|
||||
</span><span class='comment'># "consumer 0 got 1. payload 2 from producer 1"]
|
||||
</span></code></pre>
|
||||
|
||||
<h3>Synchronization of workers by passing a value</h3>
|
||||
|
|
|
@ -400,6 +400,8 @@ lead to suboptimal performance.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
|
|
@ -194,7 +194,7 @@ automatically be restarted.</p>
|
|||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<li class="public deprecated">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#auto_terminate=-instance_method" title="#auto_terminate= (instance method)">#<strong>auto_terminate=</strong>(value) ⇒ Boolean </a>
|
||||
|
@ -207,11 +207,11 @@ automatically be restarted.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
<span class="deprecated note title">deprecated</span>
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'><p>Set the auto-terminate behavior for this executor.</p>
|
||||
<span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'><p>Has no effect</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
@ -675,7 +675,9 @@ automatically be restarted.</p>
|
|||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p>Set the auto-terminate behavior for this executor.</p>
|
||||
<div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'><p>Has no effect</p>
|
||||
</div></div>
|
||||
<p>Set the auto-terminate behavior for this executor.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
|
|
@ -155,9 +155,7 @@ implementation. <code><id></code> is uniq for each thread.</li>
|
|||
<li><code>max_queue</code>: The maximum number of tasks that may be waiting in the work queue at
|
||||
any one time. When the queue size reaches <code>max_queue</code> and no new threads can be created,
|
||||
subsequent tasks will be rejected in accordance with the configured <code>fallback_policy</code>.</li>
|
||||
<li><code>auto_terminate</code>: When true (default) an <code>at_exit</code> handler will be registered which
|
||||
will stop the thread pool when the application exits. See below for more information
|
||||
on shutting down thread pools.</li>
|
||||
<li><code>auto_terminate</code>: When true (default), the threads started will be marked as daemon.</li>
|
||||
<li><code>fallback_policy</code>: The policy defining how rejected tasks are handled.</li>
|
||||
</ul>
|
||||
|
||||
|
@ -187,15 +185,11 @@ the orderly shutdown to complete</li>
|
|||
|
||||
<p>On some runtime platforms (most notably the JVM) the application will not
|
||||
exit until all thread pools have been shutdown. To prevent applications from
|
||||
"hanging" on exit all thread pools include an <code>at_exit</code> handler that will
|
||||
stop the thread pool when the application exits. This handler uses a brute
|
||||
force method to stop the pool and makes no guarantees regarding resources being
|
||||
used by any tasks still running. Registration of this <code>at_exit</code> handler can be
|
||||
prevented by setting the thread pool's constructor <code>:auto_terminate</code> option to
|
||||
<code>false</code> when the thread pool is created. All thread pools support this option.</p>
|
||||
"hanging" on exit, all threads can be marked as daemon according to the
|
||||
<code>:auto_terminate</code> option.</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># an `at_exit` handler will be registered
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># prevent `at_exit` handler registration
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_pool1'>pool1</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'># threads will be marked as daemon
|
||||
</span><span class='id identifier rubyid_pool2'>pool2</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Concurrent.html" title="Concurrent (module)">Concurrent</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FixedThreadPool.html" title="Concurrent::FixedThreadPool (class)">FixedThreadPool</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FixedThreadPool.html#initialize-instance_method" title="Concurrent::FixedThreadPool#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span> <span class='label'>auto_terminate:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='comment'># mark threads as non-daemon
|
||||
</span></code></pre>
|
||||
|
||||
|
||||
|
@ -213,7 +207,7 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
|
||||
<li><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html" target="_parent" title="Java ExecutorService interface">Java ExecutorService interface</a></li>
|
||||
|
||||
<li><a href="http://ruby-doc.org//core-2.2.0/Kernel.html#method-i-at_exit" target="_parent" title="Kernel#at_exit">Kernel#at_exit</a></li>
|
||||
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-" target="_parent" title="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-">https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -572,7 +566,7 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<li class="public deprecated">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#auto_terminate=-instance_method" title="#auto_terminate= (instance method)">#<strong>auto_terminate=</strong>(value) ⇒ Boolean </a>
|
||||
|
@ -585,11 +579,11 @@ prevented by setting the thread pool's constructor <code>:auto_terminate</co
|
|||
|
||||
|
||||
|
||||
|
||||
<span class="deprecated note title">deprecated</span>
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'><p>Set the auto-terminate behavior for this executor.</p>
|
||||
<span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'><p>Has no effect</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
@ -2253,7 +2247,9 @@ new tasks. A value of -1 indicates that the queue may grow without bound.</p>
|
|||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p>Set the auto-terminate behavior for this executor.</p>
|
||||
<div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'><p>Has no effect</p>
|
||||
</div></div>
|
||||
<p>Set the auto-terminate behavior for this executor.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
|
|
@ -246,6 +246,8 @@ Each task is represented as a <code>ScheduledTask</code>.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
|
|
|
@ -732,6 +732,8 @@ or Haskell) as we are likely to get in Ruby.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
|
|
|
@ -59,6 +59,16 @@
|
|||
|
||||
<div id="content"><div id='filecontents'><h2>Current</h2>
|
||||
|
||||
<h2>Release v1.1.6, edge v0.6.0 (10 Feb 2020)</h2>
|
||||
|
||||
<p>concurrent-ruby:</p>
|
||||
|
||||
<ul>
|
||||
<li>Concurrent.disable_at_exit_handlers! is no longer needed and was deprecated.</li>
|
||||
<li>AbstractExecutorService#auto_terminate= was deprecated and has no effect.
|
||||
Set :auto_terminate option instead when executor is initialized.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Release v1.1.6.pre1, edge v0.6.0.pre1 (26 Jan 2020)</h2>
|
||||
|
||||
<p>concurrent-ruby:</p>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -708,7 +708,7 @@
|
|||
</li>
|
||||
|
||||
|
||||
<li class="even ">
|
||||
<li class="even deprecated">
|
||||
<div class="item">
|
||||
<span class='object_link'><a href="Concurrent/SingleThreadExecutor.html#auto_terminate=-instance_method" title="Concurrent::SingleThreadExecutor#auto_terminate= (method)">#auto_terminate=</a></span>
|
||||
<small>Concurrent::SingleThreadExecutor</small>
|
||||
|
@ -716,7 +716,7 @@
|
|||
</li>
|
||||
|
||||
|
||||
<li class="odd ">
|
||||
<li class="odd deprecated">
|
||||
<div class="item">
|
||||
<span class='object_link'><a href="Concurrent/ThreadPoolExecutor.html#auto_terminate=-instance_method" title="Concurrent::ThreadPoolExecutor#auto_terminate= (method)">#auto_terminate=</a></span>
|
||||
<small>Concurrent::ThreadPoolExecutor</small>
|
||||
|
@ -1692,7 +1692,7 @@
|
|||
</li>
|
||||
|
||||
|
||||
<li class="odd ">
|
||||
<li class="odd deprecated">
|
||||
<div class="item">
|
||||
<span class='object_link'><a href="Concurrent.html#disable_at_exit_handlers!-class_method" title="Concurrent.disable_at_exit_handlers! (method)">disable_at_exit_handlers!</a></span>
|
||||
<small>Concurrent</small>
|
||||
|
|
Loading…
Reference in New Issue