gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 182/324: doc: Document the asynchronuousity of connectin


From: gnunet
Subject: [gnunet-scheme] 182/324: doc: Document the asynchronuousity of connecting.
Date: Tue, 21 Sep 2021 13:23:42 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 84a47fb8fc07cd22965422cae540fe5c6962c641
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat Aug 14 20:06:35 2021 +0200

    doc: Document the asynchronuousity of connecting.
    
    * doc/scheme-gnunet.tm (Asynchronuously connecting): New section.
---
 doc/scheme-gnunet.tm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/doc/scheme-gnunet.tm b/doc/scheme-gnunet.tm
index 1e805a8..607c87c 100644
--- a/doc/scheme-gnunet.tm
+++ b/doc/scheme-gnunet.tm
@@ -224,6 +224,36 @@
     (define mq (connect/fibers config "nse" handlers error-handler))
   </scm-code>
 
+  <subsection|Asynchronuously connecting>
+
+  This is an asynchronuous operation: it will \<#2018\>complete\<#2019\>
+  immediately and the connection will actually be formed in the
+  background.<space|1em>When the connection has actually be formed, the
+  <scm|error-handler> is called with the symbol
+  <scm|connection:connected>.<space|1em>To demonstrate, the following code
+  asynchronuously connects to the NSE service, and prints the text
+  <scm|"connected!"> when the connection has actually been formed.
+
+  <\scm-code>
+    ;; XXX test this, explain 'config' ...
+
+    (define (error-handler error . args)
+
+    \ \ (case error
+
+    \ \ \ \ ((connection:connected)
+
+    \ \ \ \ \ (format #t "connected!~%"))
+
+    \ \ \ \ (else (format #t "unknown error: ~a ~a~%" error args))))
+
+    \;
+
+    (define mq
+
+    \ \ (connect/fibers config "nse" (message-handlers) error-handler))
+  </scm-code>
+
   TODO information about message handlers, error handler <text-dots>
 
   <section|Estimation of the size of the network>

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]