Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 19a466aa43e0f0793b72d6a6c3524ff5 > files > 88

ocaml-async_unix-devel-109.24.00-2.mga4.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Select_file_descr_watcher.html">
<link rel="next" href="Signal.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Async_print" rel="Chapter" href="Async_print.html">
<link title="Async_sys" rel="Chapter" href="Async_sys.html">
<link title="Epoll_file_descr_watcher" rel="Chapter" href="Epoll_file_descr_watcher.html">
<link title="Fd" rel="Chapter" href="Fd.html">
<link title="Fd_by_descr" rel="Chapter" href="Fd_by_descr.html">
<link title="File_descr_watcher_intf" rel="Chapter" href="File_descr_watcher_intf.html">
<link title="Import" rel="Chapter" href="Import.html">
<link title="Interruptor" rel="Chapter" href="Interruptor.html">
<link title="In_thread" rel="Chapter" href="In_thread.html">
<link title="Io_stats" rel="Chapter" href="Io_stats.html">
<link title="Process" rel="Chapter" href="Process.html">
<link title="Raw_fd" rel="Chapter" href="Raw_fd.html">
<link title="Raw_scheduler" rel="Chapter" href="Raw_scheduler.html">
<link title="Raw_signal_manager" rel="Chapter" href="Raw_signal_manager.html">
<link title="Reader" rel="Chapter" href="Reader.html">
<link title="Read_write" rel="Chapter" href="Read_write.html">
<link title="Scheduler" rel="Chapter" href="Scheduler.html">
<link title="Select_file_descr_watcher" rel="Chapter" href="Select_file_descr_watcher.html">
<link title="Shutdown" rel="Chapter" href="Shutdown.html">
<link title="Signal" rel="Chapter" href="Signal.html">
<link title="Signal_manager" rel="Chapter" href="Signal_manager.html">
<link title="Std" rel="Chapter" href="Std.html">
<link title="Syscall" rel="Chapter" href="Syscall.html">
<link title="Thread_pool" rel="Chapter" href="Thread_pool.html">
<link title="Thread_safe" rel="Chapter" href="Thread_safe.html">
<link title="Thread_safe_pipe" rel="Chapter" href="Thread_safe_pipe.html">
<link title="Unix_syscalls" rel="Chapter" href="Unix_syscalls.html">
<link title="Writer" rel="Chapter" href="Writer.html"><title>Shutdown</title>
</head>
<body>
<div class="navbar"><a class="pre" href="Select_file_descr_watcher.html" title="Select_file_descr_watcher">Previous</a>
&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;<a class="post" href="Signal.html" title="Signal">Next</a>
</div>
<h1>Module <a href="type_Shutdown.html">Shutdown</a></h1>

<pre><span class="keyword">module</span> Shutdown: <code class="code">sig</code> <a href="Shutdown.html">..</a> <code class="code">end</code></pre><div class="info module top">
<code class="code">shutdown ?force status</code> initiates shutdown, which runs all the <code class="code">at_shutdown</code>
    functions, waits for them to finish, and then exits with the supplied status.  The
    <code class="code">at_shutdown</code> functions can block -- one can use <code class="code">~force</code> to forcibly exit (with
    status 1) if the <code class="code">at_shutdown</code> functions do not finish in a reasonable amount of time.
<p>

    By default, <code class="code">force</code> is <code class="code">after (sec 10.)</code>.
<p>

    Repeated calls to <code class="code">shutdown</code> with the same status will have no effect.  Any call to
    <code class="code">shutdown</code> with nonzero status will cause that to be the status that is exited with.
    A call to <code class="code">shutdown</code> with different nonzero status from the original call will
    raise.<br>
</div>
<hr width="100%">

<pre><span id="VALshutdown"><span class="keyword">val</span> shutdown</span> : <code class="type">?force:unit Import.Deferred.t -> int -> unit</code></pre><div class="info ">
<code class="code">shutdown ?force status</code> initiates shutdown, which runs all the <code class="code">at_shutdown</code>
    functions, waits for them to finish, and then exits with the supplied status.  The
    <code class="code">at_shutdown</code> functions can block -- one can use <code class="code">~force</code> to forcibly exit (with
    status 1) if the <code class="code">at_shutdown</code> functions do not finish in a reasonable amount of time.
<p>

    By default, <code class="code">force</code> is <code class="code">after (sec 10.)</code>.
<p>

    Repeated calls to <code class="code">shutdown</code> with the same status will have no effect.  Any call to
    <code class="code">shutdown</code> with nonzero status will cause that to be the status that is exited with.
    A call to <code class="code">shutdown</code> with different nonzero status from the original call will
    raise.<br>
</div>

<pre><span id="VALexit"><span class="keyword">val</span> exit</span> : <code class="type">?force:unit Import.Deferred.t -> int -> 'a Import.Deferred.t</code></pre><div class="info ">
<code class="code">exit ?force status</code> is <code class="code">shutdown ?force status; Deferred.never ()</code>.
<p>

    We do not have an exit function that returns a non-deferred:
<p>

    <pre class="codepre"><code class="code">      val exit : ?force:unit Deferred.t -&gt; int -&gt; _
    </code></pre>
<p>

    Such a function should not exist, for the same reason that we do not have:
<p>

    <pre class="codepre"><code class="code">      val block : 'a Deferred.t -&gt; 'a
    </code></pre>
<p>

    The semantics of such an exit function would allow one to block a running async job,
    and to switch to another one (to run the <code class="code">at_shutdown</code> handlers), without expressing
    that switch in the type system via a <code class="code">Deferred.t</code>.  That would eliminate all the nice
    reasoning guarantees that async gives about concurrent jobs.<br>
</div>

<pre><span id="VALshutting_down"><span class="keyword">val</span> shutting_down</span> : <code class="type">unit -> [ `No | `Yes of int ]</code></pre><div class="info ">
<code class="code">shutting_down ()</code> reports whether we are currently shutting down, and if so, with
    what status.<br>
</div>

<pre><span id="VALat_shutdown"><span class="keyword">val</span> at_shutdown</span> : <code class="type">(unit -> unit Import.Deferred.t) -> unit</code></pre><div class="info ">
<code class="code">at_shutdown f</code> causes <code class="code">f ()</code> to be run when <code class="code">shutdown</code> is called, and for <code class="code">shutdown</code>
    to wait until the returned deferred finishes.<br>
</div>

<pre><span id="VALdon't_finish_before"><span class="keyword">val</span> don't_finish_before</span> : <code class="type">unit Import.Deferred.t -> unit</code></pre><div class="info ">
<code class="code">don't_finish_before d</code> causes <code class="code">shutdown</code> to wait until <code class="code">d</code> becomes determined before
    finishing.  It is like <code class="code">at_shutdown (fun _ -&gt; d)</code>, except it is more efficient, and
    will not take any space once <code class="code">d</code> is determined.  There is a a single <code class="code">at_shutdown</code>
    shared among all deferreds supplied to <code class="code">don't_finish_before</code>.<br>
</div>
</body></html>