summaryrefslogtreecommitdiff
path: root/devdocs/elisp/transaction-queues.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/transaction-queues.html
new repository
Diffstat (limited to 'devdocs/elisp/transaction-queues.html')
-rw-r--r--devdocs/elisp/transaction-queues.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/devdocs/elisp/transaction-queues.html b/devdocs/elisp/transaction-queues.html
new file mode 100644
index 00000000..97afaf4a
--- /dev/null
+++ b/devdocs/elisp/transaction-queues.html
@@ -0,0 +1,14 @@
+ <h3 class="section">Transaction Queues</h3> <p>You can use a <em>transaction queue</em> to communicate with a subprocess using transactions. First use <code>tq-create</code> to create a transaction queue communicating with a specified process. Then you can call <code>tq-enqueue</code> to send a transaction. </p> <dl> <dt id="tq-create">Function: <strong>tq-create</strong> <em>process</em>
+</dt> <dd><p>This function creates and returns a transaction queue communicating with <var>process</var>. The argument <var>process</var> should be a subprocess capable of sending and receiving streams of bytes. It may be a child process, or it may be a TCP connection to a server, possibly on another machine. </p></dd>
+</dl> <dl> <dt id="tq-enqueue">Function: <strong>tq-enqueue</strong> <em>queue question regexp closure fn &amp;optional delay-question</em>
+</dt> <dd>
+<p>This function sends a transaction to queue <var>queue</var>. Specifying the queue has the effect of specifying the subprocess to talk to. </p> <p>The argument <var>question</var> is the outgoing message that starts the transaction. The argument <var>fn</var> is the function to call when the corresponding answer comes back; it is called with two arguments: <var>closure</var>, and the answer received. </p> <p>The argument <var>regexp</var> is a regular expression that should match text at the end of the entire answer, but nothing before; that’s how <code>tq-enqueue</code> determines where the answer ends. </p> <p>If the argument <var>delay-question</var> is non-<code>nil</code>, delay sending this question until the process has finished replying to any previous questions. This produces more reliable results with some processes. </p>
+</dd>
+</dl> <dl> <dt id="tq-close">Function: <strong>tq-close</strong> <em>queue</em>
+</dt> <dd><p>Shut down transaction queue <var>queue</var>, waiting for all pending transactions to complete, and then terminate the connection or child process. </p></dd>
+</dl> <p>Transaction queues are implemented by means of a filter function. See <a href="filter-functions">Filter Functions</a>. </p><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Transaction-Queues.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Transaction-Queues.html</a>
+ </p>
+</div>