@ciao-lang/ts-ciao-interface
Version:
Simple Ciao interface for node.
23 lines • 10.1 kB
HTML
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="theme-color" content="#273f79"/><link rel="stylesheet" href="lpdoc.css" type="text/css"/><script type="text/javascript" src="lpdoc.js"></script><title>Process channels — The Ciao System v1.22</title></head><body><div class="lpdoc-page fixleftbar"><a href="#" id="sidebar-toggle-button" class="lpdoc-navbutton"><span id="sidebar-button-arrow">☰</span></a><div id="sidebar" class="lpdoc-sidebar"><div style="height: 40px; margin-left: auto; margin-right: auto"><img src="ciao-logo_autofig.png" width=auto height=100%></div><div class="lpdoc-nav"><span class="lpdoc-on-right"><a class="lpdoc-navbutton" href="process.html">↑</a><a class="lpdoc-navbutton" href="process.html">←</a><a class="lpdoc-navbutton" href="ExtraLibs.html">→</a><a class="lpdoc-navbutton" href="ciaosearch.html">🔍</a></span><span><a href="ciaofulltoc.html">TOC</a></span></div><hr></hr><ul class="lpdoc-itemize-sectpath"><li><a href="ciao.html">The Ciao System</a> »<br/> </li><li><a href="StdLibs.html">PART VII - Standard libraries</a> »<br/> </li><li><a href="process.html">Processes (multitasking)</a> »<br/> </li><li><a href=""><strong>Process channels</strong></a></li></ul><hr></hr><em>ON THIS PAGE</em><ul><li><a href="#Usage and interface">Usage and interface</a></li><li><a href="#Documentation on exports">Documentation on exports</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Process channels</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#process_channel"></a>
<strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="Jose F. Morales" href="ciaosearch.html#Jose F. Morales">Jose F. Morales</a>.<p>
This module provides an abstraction for communication channels between processes (<a class="lpdoc-idx-anchor" id="0" href="process.html"><tt>process</tt></a>) based on standard input/output/error streams.<br/><div id="Usage and interface"><h2>Usage and interface</h2><div class="lpdoc-cartouche"><ul><li><strong>Library usage:</strong><br/><tt>:- use_module(library(process/process_channel)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="1" href="#channel_bindings/2"><tt>channel_bindings/2</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#cleanup_binding/1"><tt>cleanup_binding/1</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#binding_port_call/1"><tt>binding_port_call/1</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="#send_input/2"><tt>send_input/2</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#receive_output/2"><tt>receive_output/2</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="#open_redirect/3"><tt>open_redirect/3</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="#close_redirect/2"><tt>close_redirect/2</tt></a>.
<li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="8" href="#process_channel/1"><tt>process_channel/1</tt></a>.
</ul></ul></div></div><div id="Documentation on exports"><h2>Documentation on exports</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="process_channel/1" href="ciaosearch.html#process_channel/1">process_channel/1</a></div><div class="lpdoc-deftext"> <dl> <dt><tt>default</tt><dd> the default descriptor <dt><tt>null</tt><dd> the null stream (see <a class="lpdoc-idx-anchor" id="9" href="system.html#dev_null/1"><tt>dev_null/1</tt></a>) <dt><tt>pipe(-Stream)</tt><dd> a pipe (<span class="lpdoc-var">Stream</span> unified with the parent's read/write end of the pipe) <dt><tt>file(+File)</tt><dd> a file <span class="lpdoc-var">File</span> <dt><tt>stream(+Stream)</tt><dd> a stream <span class="lpdoc-var">Stream</span> (must be opened with the right mode) <dt><tt>file_append(+File)</tt><dd> a file <span class="lpdoc-var">File</span>, where writes are appended to the end <dt><tt>string(?String)</tt><dd> a string (list of codes) <dt><tt>line(?Line)</tt><dd> a string, ignoring trailing new line character <dt><tt>atmlist(?Xs)</tt><dd> a list of atoms (for each line) <dt><tt>terms(?Xs)</tt><dd> terms, ended in full-stop (using <a class="lpdoc-idx-anchor" id="10" href="iso_incomplete.html#read_term/3"><tt>read_term/3</tt></a> and <a class="lpdoc-idx-anchor" id="11" href="iso_incomplete.html#write_canonical/2"><tt>write_canonical/2</tt></a>) <dt><tt>stdout</tt><dd> (only valid for <tt>stderr(_)</tt>) redirect to the same channel than stdout (useful for redirecting both standard output and standard error). </dl> <p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>process_channel(Channel)</tt>
</span><p>A communication channel for standard file descriptors</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="channel_bindings/2" href="ciaosearch.html#channel_bindings/2">channel_bindings/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>channel_bindings(Channels,ChannelBinds)</tt>
</span><p>Create channel bindings (taking into account pipes)</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="cleanup_binding/1" href="ciaosearch.html#cleanup_binding/1">cleanup_binding/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>cleanup_binding(ChannelB)</tt>
</span><p>Cleanup temporaries due to channel file-based bindings.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="binding_port_call/1" href="ciaosearch.html#binding_port_call/1">binding_port_call/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>binding_port_call(ChannelB)</tt>
</span><p>Do port_call/1 on the result of channel transfer (send or receive).</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="send_input/2" href="ciaosearch.html#send_input/2">send_input/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>send_input(Mode,ChannelBinding)</tt>
</span><p>Send input through channel binding <span class="lpdoc-var">ChannelBinding</span>. Transfer status is internally stored (see <a class="lpdoc-idx-anchor" id="12" href="#binding_port_call/1"><tt>binding_port_call/1</tt></a>).</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="receive_output/2" href="ciaosearch.html#receive_output/2">receive_output/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>receive_output(Mode,ChannelBinding)</tt>
</span><p>Receive output from channel binding <span class="lpdoc-var">ChannelBinding</span>. Transfer status is internally stored (see <a class="lpdoc-idx-anchor" id="13" href="#binding_port_call/1"><tt>binding_port_call/1</tt></a>).</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="open_redirect/3" href="ciaosearch.html#open_redirect/3">open_redirect/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>open_redirect(ChannelB,Mode,S)</tt>
</span><p>Open stream file redirections (for internals:'$exec'/9).</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="close_redirect/2" href="ciaosearch.html#close_redirect/2">close_redirect/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>close_redirect(ChannelB,S)</tt>
</span><p>Close stream file redirections (for internals:'$exec'/9).</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
</div><div id="Documentation on imports"><h2>Documentation on imports</h2>This module has the following direct dependencies:<ul class="lpdoc-itemize-minus"><li><em>System library modules:</em><br/><a class="lpdoc-idx-anchor" id="14" href="lists.html"><tt>lists</tt></a>, <a class="lpdoc-idx-anchor" id="15" href="port_reify.html"><tt>port_reify</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="system.html"><tt>system</tt></a>, <a class="lpdoc-idx-anchor" id="17" href="read.html"><tt>read</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="write.html"><tt>write</tt></a>, <a class="lpdoc-idx-anchor" id="19" href="stream_utils.html"><tt>stream_utils</tt></a>.
<li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="20" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="21" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="22" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="23" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="24" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="25" href="regtypes_doc.html"><tt>regtypes</tt></a>, <a class="lpdoc-idx-anchor" id="26" href="isomodes_doc.html"><tt>isomodes</tt></a>, <a class="lpdoc-idx-anchor" id="27" href="ciaosearch.html#hiord"><tt>hiord</tt></a>.
</ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>