Sophie

Sophie

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

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="Thread_safe.html">
<link rel="next" href="Unix_syscalls.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>Thread_safe_pipe</title>
</head>
<body>
<div class="navbar"><a class="pre" href="Thread_safe.html" title="Thread_safe">Previous</a>
&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;<a class="post" href="Unix_syscalls.html" title="Unix_syscalls">Next</a>
</div>
<h1>Module <a href="type_Thread_safe_pipe.html">Thread_safe_pipe</a></h1>

<pre><span class="keyword">module</span> Thread_safe_pipe: <code class="code">sig</code> <a href="Thread_safe_pipe.html">..</a> <code class="code">end</code></pre><div class="info module top">
A thread-safe pipe is a thread-safe interface to the write end of a normal
    <code class="code">Async.Pipe</code>.  All operations except for <code class="code">create</code> must be called from threads outside
    async.  <code class="code">create</code> can be called from inside or outside async.
<p>

    For <code class="code">Pipe</code> functions that return a <code class="code">unit Deferred.t</code>, the analog in <code class="code">Thread_safe_pipe</code>
    blocks.
<p>

    For documentation of <code class="code">wakeup_scheduler</code>, see the <a href="Thread_safe.html"><code class="code">Thread_safe</code></a> module.<br>
</div>
<hr width="100%">

<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type">'a</code> t</span> </pre>


<pre><span id="VALcreate"><span class="keyword">val</span> create</span> : <code class="type">unit -> 'a Import.Pipe.Reader.t * 'a <a href="Thread_safe_pipe.html#TYPEt">t</a></code></pre><div class="info ">
<code class="code">create ()</code> returns a reader end, which must be used inside async, and a writer end,
    which must be used outside async.  <code class="code">create</code> can be called inside or outside async.<br>
</div>
<br>
All the following functions must be called outside async.  They behave as their
    counterpart in the <code class="code">Pipe</code> module.<br>

<pre><span id="VALpushback"><span class="keyword">val</span> pushback</span> : <code class="type">'a <a href="Thread_safe_pipe.html#TYPEt">t</a> -> unit</code></pre><div class="info ">
<code class="code">pushback writer</code> blocks the current thread until the pipe is empty or closed.<br>
</div>

<pre><span id="VALwrite_without_pushback'"><span class="keyword">val</span> write_without_pushback'</span> : <code class="type">?wakeup_scheduler:bool -><br>       'a <a href="Thread_safe_pipe.html#TYPEt">t</a> -> 'a Core.Std.Queue.t -> unit</code></pre><div class="info ">
<code class="code">write_without_pushback'</code> and <code class="code">write_without_pushback</code> transfer the element(s) into
    the pipe and return immediately.<br>
</div>

<pre><span id="VALwrite_without_pushback"><span class="keyword">val</span> write_without_pushback</span> : <code class="type">?wakeup_scheduler:bool -> 'a <a href="Thread_safe_pipe.html#TYPEt">t</a> -> 'a -> unit</code></pre>
<pre><span id="VALwrite'"><span class="keyword">val</span> write'</span> : <code class="type">'a <a href="Thread_safe_pipe.html#TYPEt">t</a> -> 'a Core.Std.Queue.t -> unit</code></pre><div class="info ">
<code class="code">write'</code> and <code class="code">write</code> transfer the element(s) into the pipe and block the current
    thread until the pipe is empty or closed (like <a href="Thread_safe_pipe.html#VALpushback"><code class="code">Thread_safe_pipe.pushback</code></a>).<br>
</div>

<pre><span id="VALwrite"><span class="keyword">val</span> write</span> : <code class="type">'a <a href="Thread_safe_pipe.html#TYPEt">t</a> -> 'a -> unit</code></pre>
<pre><span id="VALclose"><span class="keyword">val</span> close</span> : <code class="type">'a <a href="Thread_safe_pipe.html#TYPEt">t</a> -> unit</code></pre>
<pre><span id="VALis_closed"><span class="keyword">val</span> is_closed</span> : <code class="type">'a <a href="Thread_safe_pipe.html#TYPEt">t</a> -> bool</code></pre>
<pre><span id="VALclosed"><span class="keyword">val</span> closed</span> : <code class="type">'a <a href="Thread_safe_pipe.html#TYPEt">t</a> -> unit</code></pre><div class="info ">
<code class="code">closed writer</code> blocks the current thread until the pipe is closed.<br>
</div>

<pre><span id="VALsexp_of_t"><span class="keyword">val</span> sexp_of_t</span> : <code class="type">('a -> Sexplib.Sexp.t) -> 'a <a href="Thread_safe_pipe.html#TYPEt">t</a> -> Sexplib.Sexp.t</code></pre><br>
<code class="code">create ()</code> returns a reader end, which must be used inside async, and a writer end,
    which must be used outside async.  <code class="code">create</code> can be called inside or outside async.<br>
<br>
All the following functions must be called outside async.  They behave as their
    counterpart in the <code class="code">Pipe</code> module.<br>
<br>
<code class="code">pushback writer</code> blocks the current thread until the pipe is empty or closed.<br>
<br>
<code class="code">write_without_pushback'</code> and <code class="code">write_without_pushback</code> transfer the element(s) into
    the pipe and return immediately.<br>
<br>
<code class="code">write'</code> and <code class="code">write</code> transfer the element(s) into the pipe and block the current
    thread until the pipe is empty or closed (like <a href="Thread_safe_pipe.html#VALpushback"><code class="code">Thread_safe_pipe.pushback</code></a>).<br>
<br>
<code class="code">closed writer</code> blocks the current thread until the pipe is closed.<br>
</body></html>