summaryrefslogtreecommitdiff
path: root/devdocs/elisp/jsonrpc-deferred-requests.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/jsonrpc-deferred-requests.html
new repository
Diffstat (limited to 'devdocs/elisp/jsonrpc-deferred-requests.html')
-rw-r--r--devdocs/elisp/jsonrpc-deferred-requests.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/devdocs/elisp/jsonrpc-deferred-requests.html b/devdocs/elisp/jsonrpc-deferred-requests.html
new file mode 100644
index 00000000..5986c7d4
--- /dev/null
+++ b/devdocs/elisp/jsonrpc-deferred-requests.html
@@ -0,0 +1,6 @@
+ <h4 class="subsection">Deferred JSONRPC requests</h4> <p>In many <acronym>RPC</acronym> situations, synchronization between the two communicating endpoints is a matter of correctly designing the RPC application: when synchronization is needed, requests (which are blocking) should be used; when it isn’t, notifications should suffice. However, when Emacs acts as one of these endpoints, asynchronous events (e.g. timer- or process-related) may be triggered while there is still uncertainty about the state of the remote endpoint. Furthermore, acting on these events may only sometimes demand synchronization, depending on the event’s specific nature. </p> <p>The <code>:deferred</code> keyword argument to <code>jsonrpc-request</code> and <code>jsonrpc-async-request</code> is designed to let the caller indicate that the specific request needs synchronization and its actual issuance may be delayed to the future, until some condition is satisfied. Specifying <code>:deferred</code> for a request doesn’t mean it <em>will</em> be delayed, only that it <em>can</em> be. If the request isn’t sent immediately, <code>jsonrpc</code> will make renewed efforts to send it at certain key times during communication, such as when receiving or sending other messages to the endpoint. </p> <p>Before any attempt to send the request, the application-specific conditions are checked. Since the <code>jsonrpc</code> library can’t know what these conditions are, the program can use the <code>jsonrpc-connection-ready-p</code> generic function (see <a href="generic-functions">Generic Functions</a>) to specify them. The default method for this function returns <code>t</code>, but you can add overriding methods that return <code>nil</code> in some situations, based on the arguments passed to it, which are the <code>jsonrpc-connection</code> object (see <a href="jsonrpc-overview">JSONRPC Overview</a>) and whichever value you passed as the <code>:deferred</code> keyword argument. </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/JSONRPC-deferred-requests.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/JSONRPC-deferred-requests.html</a>
+ </p>
+</div>