@ciao-lang/ts-ciao-interface
Version:
Simple Ciao interface for node.
65 lines • 20.5 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>Active module processes — 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="actmod_doc.html">↑</a><a class="lpdoc-navbutton" href="regp_webbased.html">←</a><a class="lpdoc-navbutton" href="actmod_rt.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="ExtendLang.html">PART IV - Language extensions</a> »<br/> </li><li><a href="actmod_doc.html">Active modules</a> »<br/> </li><li><a href=""><strong>Active module processes</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 multifiles">Documentation on multifiles</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Active module processes</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#actmod_process"></a>
This module provides predicates to create and handle active module instances. Note that each instance is associated with its own computational resources.<p>Active module instance run on their own <a class="lpdoc-idx-anchor" id="0" href="ciaosearch.html#fiber">fiber</a>s (optionally in a new process) for an <span class="lpdoc-var">DMod</span>. <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(actmod/actmod_process)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="1" href="#actmod_spawn/3"><tt>actmod_spawn/3</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#actmod_kill/2"><tt>actmod_kill/2</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#actmod_terminate/2"><tt>actmod_terminate/2</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="#actmod_join/1"><tt>actmod_join/1</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#actmod_compile_all/0"><tt>actmod_compile_all/0</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="#actmod_compile/1"><tt>actmod_compile/1</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="#actmod_check_bin/1"><tt>actmod_check_bin/1</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="#actmod_load_dynmod/1"><tt>actmod_load_dynmod/1</tt></a>.
<li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="9" href="actmod_dist.html#actref/1"><tt>actref/1</tt></a>, <a class="lpdoc-idx-anchor" id="10" href="#spawn_opt/1"><tt>spawn_opt/1</tt></a>.
<li><em>Multifiles:</em><br/><a class="lpdoc-idx-anchor" id="11" href="actmod_dist.html#actmod_publish.save_addr/6"><tt>actmod_publish.save_addr/6</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="actmod_dist.html#actmod_locate.remote_address/4"><tt>actmod_locate.remote_address/4</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="actmod_dist.html#actmod_locate.cleanup_actI/2"><tt>actmod_locate.cleanup_actI/2</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="actmod_dist.html#$dist_addr_retry/1"><tt>$dist_addr_retry/1</tt></a>, <a class="lpdoc-idx-anchor" id="15" href="actmod_dist.html#$dmod_reg_protocol/2"><tt>$dmod_reg_protocol/2</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="actmod_dist.html#$dmod_src/2"><tt>$dmod_src/2</tt></a>, <a class="lpdoc-idx-anchor" id="17" href="actmod_dist.html#$dmod_prop/2"><tt>$dmod_prop/2</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="actmod_dist.html#$local_actmod/1"><tt>$local_actmod/1</tt></a>, <a class="lpdoc-idx-anchor" id="19" href="actmod_dist.html#$static_named_actRef/2"><tt>$static_named_actRef/2</tt></a>, <a class="lpdoc-idx-anchor" id="20" href="actmod_dist.html#$dmod_proxy/2"><tt>$dmod_proxy/2</tt></a>, <a class="lpdoc-idx-anchor" id="21" href="actmod_dist.html#$actmod_exe/3"><tt>$actmod_exe/3</tt></a>, <a class="lpdoc-idx-anchor" id="22" href="actmod_dist.html#qprot.collect/3"><tt>qprot.collect/3</tt></a>, <a class="lpdoc-idx-anchor" id="23" href="actmod_dist.html#qprot.dec/4"><tt>qprot.dec/4</tt></a>, <a class="lpdoc-idx-anchor" id="24" href="actmod_dist.html#qprot.enc/3"><tt>qprot.enc/3</tt></a>, <a class="lpdoc-idx-anchor" id="25" href="actmod_dist.html#qprot.prepare_query/4"><tt>qprot.prepare_query/4</tt></a>, <a class="lpdoc-idx-anchor" id="26" href="actmod_dist.html#qprot.join_answers/7"><tt>qprot.join_answers/7</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="actref/1" href="ciaosearch.html#actref/1">actref/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>actref(X)</tt>
</span><p><span class="lpdoc-var">X</span> is the reference of an active module instance</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="spawn_opt/1" href="ciaosearch.html#spawn_opt/1">spawn_opt/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>spawn_opt(X)</tt>
</span><p>Options to control the location of the fiber: <ul> <li><tt>child</tt>: run on a new child OS process <li><tt>daemon</tt>: run on a new <a href="https://en.wikipedia.org/wiki/Daemon_(computing)">daemon</a> OS process (background processes that are their own session and group leaders, and that are dissociated from a controlling terminal) <li>(default): run on this OS process </ul> <p>Options to specify the active module implementation: <ul> <li><tt>exec(ExecPath,ExecArgs)</tt>: path for executable and arguments (containing the distributed runtime) <li><tt>dynmod(Mod)</tt>: module spec (for spawning using a generic <tt>ciaosh</tt> runtime) <li><tt>libexec</tt>: like <tt>exec/1</tt>, using binary created by <a class="lpdoc-idx-anchor" id="27" href="#actmod_compile/1"><tt>actmod_compile/1</tt></a> at <tt>build/libexec</tt> <li><tt>binexec(Name)</tt>: use the binary <tt>Name</tt> created at <tt>build/bin</tt> (passing <tt>--actmod</tt> argument at process startup) </ul><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>spawn_opt(X)</tt>
</span><p><span class="lpdoc-var">X</span> is an spawning option</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="actmod_spawn/3" href="ciaosearch.html#actmod_spawn/3">actmod_spawn/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>actmod_spawn(DMod,Opts,ActRef)</tt>
</span><p>Create a new active module instance of <span class="lpdoc-var">DMod</span>. <span class="lpdoc-var">Opts</span> is a list of options and <span class="lpdoc-var">ActRef</span> the active module instance reference.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="28" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">DMod</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="29" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Opts</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="30" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">ActRef</span> is a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="31" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">DMod</span> is an atom.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="32" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Opts</span> is a list of <span class="lpdoc-var">spawn_opt</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="33" href="actmod_dist.html#actref/1"><tt>actmod_process:actref/1</tt></a>)</span><span><span class="lpdoc-var">ActRef</span> is the reference of an active module instance
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="actmod_kill/2" href="ciaosearch.html#actmod_kill/2">actmod_kill/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>actmod_kill(ActRef,Msg)</tt>
</span><p>Sends SIGKILL signal to the active module instance <span class="lpdoc-var">ActRef</span>. If not registered as a child process, it is considered to be a daemon. Return message in <span class="lpdoc-var">Msg</span>.</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="actmod_terminate/2" href="ciaosearch.html#actmod_terminate/2">actmod_terminate/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>actmod_terminate(ActRef,Msg)</tt>
</span><p>Sends SIGTERM signal to the active module instance <span class="lpdoc-var">ActRef</span>. If not registered as a child process, it is considered to be a daemon. Return message in <span class="lpdoc-var">Msg</span>.</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="actmod_join/1" href="ciaosearch.html#actmod_join/1">actmod_join/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>actmod_join(ActRef)</tt>
</span><p>Block until the active module instance <span class="lpdoc-var">ActRef</span> terminates</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="actmod_compile_all/0" href="ciaosearch.html#actmod_compile_all/0">actmod_compile_all/0</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><p>Compile all imported active modules (only for <tt>libexec</tt>)</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="actmod_compile/1" href="ciaosearch.html#actmod_compile/1">actmod_compile/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>actmod_compile(DMod)</tt>
</span><p>Ensure that the (imported) active module <span class="lpdoc-var">DMod</span> is compiled (only for <tt>libexec</tt>)</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="actmod_check_bin/1" href="ciaosearch.html#actmod_check_bin/1">actmod_check_bin/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>actmod_check_bin(DMod)</tt>
</span><p>Check a binary for the (imported) active module <span class="lpdoc-var">DMod</span> exists (only for <tt>libexec</tt>)</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="actmod_load_dynmod/1" href="ciaosearch.html#actmod_load_dynmod/1">actmod_load_dynmod/1</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p>
</div><div id="Documentation on multifiles"><h2>Documentation on multifiles</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="actmod_publish.save_addr/6" href="ciaosearch.html#actmod_publish.save_addr/6">actmod_publish.save_addr/6</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="actmod_locate.remote_address/4" href="ciaosearch.html#actmod_locate.remote_address/4">actmod_locate.remote_address/4</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="actmod_locate.cleanup_actI/2" href="ciaosearch.html#actmod_locate.cleanup_actI/2">actmod_locate.cleanup_actI/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="$dist_addr_retry/1" href="ciaosearch.html#$dist_addr_retry/1">$dist_addr_retry/1</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="$dmod_reg_protocol/2" href="ciaosearch.html#$dmod_reg_protocol/2">$dmod_reg_protocol/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="$dmod_src/2" href="ciaosearch.html#$dmod_src/2">$dmod_src/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="$dmod_prop/2" href="ciaosearch.html#$dmod_prop/2">$dmod_prop/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="$local_actmod/1" href="ciaosearch.html#$local_actmod/1">$local_actmod/1</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="$static_named_actRef/2" href="ciaosearch.html#$static_named_actRef/2">$static_named_actRef/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="$dmod_proxy/2" href="ciaosearch.html#$dmod_proxy/2">$dmod_proxy/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="$actmod_exe/3" href="ciaosearch.html#$actmod_exe/3">$actmod_exe/3</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="qprot.collect/3" href="ciaosearch.html#qprot.collect/3">qprot.collect/3</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="qprot.dec/4" href="ciaosearch.html#qprot.dec/4">qprot.dec/4</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="qprot.enc/3" href="ciaosearch.html#qprot.enc/3">qprot.enc/3</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="qprot.prepare_query/4" href="ciaosearch.html#qprot.prepare_query/4">qprot.prepare_query/4</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="qprot.join_answers/7" href="ciaosearch.html#qprot.join_answers/7">qprot.join_answers/7</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.
The predicate is <em>multifile</em>.<br/></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="34" href="datafacts_rt.html"><tt>datafacts_rt</tt></a>, <a class="lpdoc-idx-anchor" id="35" href="system.html"><tt>system</tt></a>, <a class="lpdoc-idx-anchor" id="36" href="system_extra.html"><tt>system_extra</tt></a>, <a class="lpdoc-idx-anchor" id="37" href="process.html"><tt>process</tt></a>, <a class="lpdoc-idx-anchor" id="38" href="actmod_rt.html"><tt>actmod_rt</tt></a>, <a class="lpdoc-idx-anchor" id="39" href="actmod_dist.html"><tt>actmod_dist</tt></a>, <a class="lpdoc-idx-anchor" id="40" href="pathnames.html"><tt>pathnames</tt></a>, <a class="lpdoc-idx-anchor" id="41" href="lists.html"><tt>lists</tt></a>, <a class="lpdoc-idx-anchor" id="42" href="ciaosearch.html#config_common"><tt>config_common</tt></a>, <a class="lpdoc-idx-anchor" id="43" href="ciaosearch.html#ciaoc_aux"><tt>ciaoc_aux</tt></a>, <a class="lpdoc-idx-anchor" id="44" href="ciaosearch.html#actmod_holder"><tt>actmod_holder</tt></a>.
<li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="45" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="46" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="47" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="48" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="49" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="50" href="fsyntax_doc.html"><tt>fsyntax</tt></a>, <a class="lpdoc-idx-anchor" id="51" href="ciaosearch.html#hiord"><tt>hiord</tt></a>, <a class="lpdoc-idx-anchor" id="52" href="isomodes_doc.html"><tt>isomodes</tt></a>, <a class="lpdoc-idx-anchor" id="53" href="regtypes_doc.html"><tt>regtypes</tt></a>, <a class="lpdoc-idx-anchor" id="54" href="datafacts_doc.html"><tt>datafacts</tt></a>, <a class="lpdoc-idx-anchor" id="55" href="traits_doc.html"><tt>traits</tt></a>.
</ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>