[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 249/324: nse/client: Prepare for auto-reconnecting.
From: |
gnunet |
Subject: |
[gnunet-scheme] 249/324: nse/client: Prepare for auto-reconnecting. |
Date: |
Tue, 21 Sep 2021 13:24:49 +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 5cfadf81bf2ac7d407e67fa9a2a2caaa7135095d
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Wed Sep 8 19:21:40 2021 +0200
nse/client: Prepare for auto-reconnecting.
* gnu/gnunet/nse/client.scm
(reconnect): Extract from ...
(connect): ... here.
---
gnu/gnunet/nse/client.scm | 37 +++++++++++++++++++++----------------
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/gnu/gnunet/nse/client.scm b/gnu/gnunet/nse/client.scm
index 4420d23..a9072ef 100644
--- a/gnu/gnunet/nse/client.scm
+++ b/gnu/gnunet/nse/client.scm
@@ -35,7 +35,7 @@
;; TODO: disconnect
estimate)
(import (only (rnrs base)
- begin define quote lambda case values expt = else)
+ begin define quote lambda case values expt = else apply)
(only (rnrs control)
when)
(only (rnrs records syntactic)
@@ -114,20 +114,9 @@ Maybe +inf.0 as well?"
timestamp."
(%estimate:timestamp estimate))
- (define* (connect config #:key updated connected disconnected
- (spawn spawn-fiber))
- "Connect to the NSE service in the background.
-
-When connected, the thunk @var{connected} is called and estimates
-will become available (but possibly not immediately). When a new
-estimate is available, the procedure @var{updated} is called. This
-procedure should accept the new estimate. When disconnected, the
-thunk @code{disconnected} and updates will be (temporarily) unavailable,
-until connected again. It is possible for @var{updated} to be called
-shortly after calling @var{disconnected}.
-
-The procedures @var{updated}, @var{connected} and @var{disconnected} are
optional."
- (define estimate/box (make-atomic-box #f))
+ ;; See 'connect'.
+ (define* (reconnect estimate/box config #:key updated connected
disconnected
+ (spawn spawn-fiber))
(define (handle-estimate! estimate-slice)
(define estimate
(%make-estimate
@@ -172,5 +161,21 @@ The procedures @var{updated}, @var{connected} and
@var{disconnected} are optiona
(values))))
(define mq (connect/fibers config "nse" handlers error-handler
#:spawn spawn))
- (signal-condition! mq-defined)
+ (signal-condition! mq-defined))
+
+ (define* (connect config #:key updated connected disconnected
+ (spawn spawn-fiber) #:rest rest)
+ "Connect to the NSE service in the background.
+
+When connected, the thunk @var{connected} is called and estimates
+will become available (but possibly not immediately). When a new
+estimate is available, the procedure @var{updated} is called. This
+procedure should accept the new estimate. When disconnected, the
+thunk @code{disconnected} and updates will be (temporarily) unavailable,
+until connected again. It is possible for @var{updated} to be called
+shortly after calling @var{disconnected}.
+
+The procedures @var{updated}, @var{connected} and @var{disconnected} are
optional."
+ (define estimate/box (make-atomic-box #f))
+ (apply reconnect estimate/box config rest)
(%make-server estimate/box))))
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet-scheme] 251/324: tests/utils: Move call-with-spawner from tests/mq-stream.scm., (continued)
- [gnunet-scheme] 251/324: tests/utils: Move call-with-spawner from tests/mq-stream.scm., gnunet, 2021/09/21
- [gnunet-scheme] 221/324: mq-impl/stream: Delay knowing the port., gnunet, 2021/09/21
- [gnunet-scheme] 228/324: doc/fdl: Correct ‘quote’ typography., gnunet, 2021/09/21
- [gnunet-scheme] 231/324: doc: Document message verifiers., gnunet, 2021/09/21
- [gnunet-scheme] 236/324: mq-impl/stream: Close the port when stopping the fibers., gnunet, 2021/09/21
- [gnunet-scheme] 242/324: nse/client: Remove unused fields., gnunet, 2021/09/21
- [gnunet-scheme] 243/324: doc/scheme-gnunet.tm: Correct use of 'connected' and 'updated'., gnunet, 2021/09/21
- [gnunet-scheme] 237/324: mq-impl/stream: Allow closing the queue on request., gnunet, 2021/09/21
- [gnunet-scheme] 247/324: nse/client: Only call 'send-start!' after 'mq' has been defined., gnunet, 2021/09/21
- [gnunet-scheme] 248/324: tests/mq-stream: Add missing parenthesis., gnunet, 2021/09/21
- [gnunet-scheme] 249/324: nse/client: Prepare for auto-reconnecting.,
gnunet <=
- [gnunet-scheme] 250/324: doc: Document that (gnu gnunet nse client) reconnects., gnunet, 2021/09/21
- [gnunet-scheme] 253/324: nse/client: Correct type documentation of <server>., gnunet, 2021/09/21
- [gnunet-scheme] 254/324: doc: Document how to disconnect from the NSE server., gnunet, 2021/09/21
- [gnunet-scheme] 258/324: build: Install compiled Guile modules in appropriate location., gnunet, 2021/09/21
- [gnunet-scheme] 256/324: nse/client: Verify positivity of estimate., gnunet, 2021/09/21
- [gnunet-scheme] 257/324: git: Mark .scm as Scheme files for diffing purposes., gnunet, 2021/09/21
- [gnunet-scheme] 261/324: git: Ignore some files created by Emacs., gnunet, 2021/09/21
- [gnunet-scheme] 259/324: build: Install the HTML and PDF documentation., gnunet, 2021/09/21
- [gnunet-scheme] 266/324: build: Add (gnu extractor enum) to the makefile., gnunet, 2021/09/21
- [gnunet-scheme] 255/324: nse/client: Remove resolved TODO., gnunet, 2021/09/21