[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.
- [gnunet-scheme] 164/324: repeated-condition: Make less fragile to SRFI-88., (continued)
- [gnunet-scheme] 164/324: repeated-condition: Make less fragile to SRFI-88., gnunet, 2021/09/21
- [gnunet-scheme] 170/324: bv-slice: Support IEEE doubles., gnunet, 2021/09/21
- [gnunet-scheme] 180/324: doc: Start writing some documentation., gnunet, 2021/09/21
- [gnunet-scheme] 184/324: cmsg: Fix broken tests., gnunet, 2021/09/21
- [gnunet-scheme] 185/324: tests/utils: Use set-value! instead of hashtable-set!., gnunet, 2021/09/21
- [gnunet-scheme] 163/324: util/time: Add time units and implement bounded exponential back-off., gnunet, 2021/09/21
- [gnunet-scheme] 169/324: mq-stream: Allow turning ports into message queues., gnunet, 2021/09/21
- [gnunet-scheme] 177/324: nse/client: Implement connecting to the NSE service., gnunet, 2021/09/21
- [gnunet-scheme] 181/324: ROADMAP: Start a TODO list for version 0.1., gnunet, 2021/09/21
- [gnunet-scheme] 183/324: tests/utils: Use a better hash function., gnunet, 2021/09/21
- [gnunet-scheme] 182/324: doc: Document the asynchronuousity of connecting.,
gnunet <=
- [gnunet-scheme] 189/324: ROADMAP: Mark ‘Document NSE’ as done, gnunet, 2021/09/21
- [gnunet-scheme] 188/324: nse/client: Document the optionality of callbacks., gnunet, 2021/09/21
- [gnunet-scheme] 187/324: doc: Document the ‘network size estimation’ API., gnunet, 2021/09/21
- [gnunet-scheme] 197/324: mq-impl/stream: Stop all fibers when EOF is reached (part 2)., gnunet, 2021/09/21
- [gnunet-scheme] 165/324: mq-impl/stream: Implement connecting to unix sockets., gnunet, 2021/09/21
- [gnunet-scheme] 171/324: util/struct: Define /time-absolute., gnunet, 2021/09/21
- [gnunet-scheme] 168/324: README: Remove paragraph about avoiding callbacks., gnunet, 2021/09/21
- [gnunet-scheme] 175/324: mq/handler: Handle the case where no handler exists., gnunet, 2021/09/21
- [gnunet-scheme] 178/324: Makefile.am: Compile with more optimisations., gnunet, 2021/09/21
- [gnunet-scheme] 174/324: nse/struct: Add missing imports., gnunet, 2021/09/21