Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
pitr-ch committed Feb 10, 2020
1 parent 8f83e4a commit 082c05f
Show file tree
Hide file tree
Showing 31 changed files with 807 additions and 785 deletions.
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
120 changes: 62 additions & 58 deletions docs/1.1.6/Concurrent.html

Large diffs are not rendered by default.

20 changes: 7 additions & 13 deletions docs/1.1.6/Concurrent/CachedThreadPool.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ <h2>Overview</h2><div class="docstring">
<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>

Expand Down Expand Up @@ -175,15 +173,11 @@ <h2>Overview</h2><div class="docstring">

<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
&quot;hanging&quot; 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&#39;s constructor <code>:auto_terminate</code> option to
<code>false</code> when the thread pool is created. All thread pools support this 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
&quot;hanging&quot; 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'># 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>


Expand All @@ -201,7 +195,7 @@ <h2>Overview</h2><div class="docstring">

<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>

Expand Down
4 changes: 2 additions & 2 deletions docs/1.1.6/Concurrent/ErlangActor.html
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ <h2>
<li class="public ">
<span class="summary_signature">

<a href="#spawn-class_method" title="#spawn (class method)">.<strong>spawn</strong>(*args, &amp;body) &#x21d2; Pid </a>
<a href="#spawn-class_method" title="#spawn (class method)">.<strong>spawn</strong>(*args, **kwargs, &amp;body) &#x21d2; Pid </a>



Expand Down Expand Up @@ -718,7 +718,7 @@ <h3 class="signature " id="default_executor-class_method">
<div class="method_details ">
<h3 class="signature " id="spawn-class_method">

.<strong>spawn</strong>(*args, &amp;body) &#x21d2; <tt><span class='object_link'><a href="ErlangActor/Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>
.<strong>spawn</strong>(*args, **kwargs, &amp;body) &#x21d2; <tt><span class='object_link'><a href="ErlangActor/Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>



Expand Down
8 changes: 4 additions & 4 deletions docs/1.1.6/Concurrent/ErlangActor/FunctionShortcuts.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h2>
<li class="public ">
<span class="summary_signature">

<a href="#spawn-instance_method" title="#spawn (instance method)">#<strong>spawn</strong>(*args, &amp;body) &#x21d2; Pid </a>
<a href="#spawn-instance_method" title="#spawn (instance method)">#<strong>spawn</strong>(*args, **kwargs, &amp;body) &#x21d2; Pid </a>



Expand Down Expand Up @@ -171,7 +171,7 @@ <h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="spawn-instance_method">

#<strong>spawn</strong>(*args, &amp;body) &#x21d2; <tt><span class='object_link'><a href="Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>
#<strong>spawn</strong>(*args, **kwargs, &amp;body) &#x21d2; <tt><span class='object_link'><a href="Pid.html" title="Concurrent::ErlangActor::Pid (class)">Pid</a></span></tt>



Expand Down Expand Up @@ -213,8 +213,8 @@ <h3 class="signature first" id="spawn-instance_method">
<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'>&amp;</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'>&amp;</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'>&amp;</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'>&amp;</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
Expand Down
36 changes: 15 additions & 21 deletions docs/1.1.6/Concurrent/FixedThreadPool.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ <h2>Overview</h2><div class="docstring">
<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>

Expand Down Expand Up @@ -163,15 +161,11 @@ <h2>Overview</h2><div class="docstring">

<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
&quot;hanging&quot; 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&#39;s constructor <code>:auto_terminate</code> option to
<code>false</code> when the thread pool is created. All thread pools support this 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
&quot;hanging&quot; 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'># 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>


Expand All @@ -189,7 +183,7 @@ <h2>Overview</h2><div class="docstring">

<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>

Expand Down Expand Up @@ -365,17 +359,17 @@ <h3 class="signature first" id="initialize-instance_method">
<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'>&#39;</span><span class='tstring_content'>number of threads must be greater than zero</span><span class='tstring_end'>&#39;</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'>&lt;</span> <span class='int'>1</span>
Expand Down
2 changes: 2 additions & 0 deletions docs/1.1.6/Concurrent/ImmediateExecutor.html
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ <h2>





<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>

Expand Down
2 changes: 2 additions & 0 deletions docs/1.1.6/Concurrent/IndirectImmediateExecutor.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ <h2>





<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>

Expand Down
2 changes: 2 additions & 0 deletions docs/1.1.6/Concurrent/SimpleExecutorService.html
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ <h2>






<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
Expand Down
10 changes: 6 additions & 4 deletions docs/1.1.6/Concurrent/SingleThreadExecutor.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ <h2>
</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) &#x21d2; Boolean </a>
Expand All @@ -207,11 +207,11 @@ <h2>




<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>
Expand Down Expand Up @@ -675,7 +675,9 @@ <h3 class="signature " id="auto_terminate=-instance_method">

</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>
Expand Down
Loading

0 comments on commit 082c05f

Please sign in to comment.