gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] branch master updated (8fcf76d -> 1f78c1e)


From: gnunet
Subject: [gnunet-scheme] branch master updated (8fcf76d -> 1f78c1e)
Date: Wed, 29 Jun 2022 23:31:47 +0200

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

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

    from 8fcf76d  service-communication: Document 
'close-not-connected-no-fallbacks'.
     new 333ca88  tests/util: Detect if Guile's connection procedure is passed.
     new 1f78c1e  lost-and-found: Export and document the 
'losable-lost-and-found'.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/concurrency.tm                        |  7 +++++++
 gnu/gnunet/concurrency/lost-and-found.scm | 12 ++++++++++--
 tests/utils.scm                           |  5 +++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/doc/concurrency.tm b/doc/concurrency.tm
index 4bea13a..ab662e5 100644
--- a/doc/concurrency.tm
+++ b/doc/concurrency.tm
@@ -86,6 +86,13 @@
     </footnote>, subtypes must define the \<#2018\>protocol\<#2019\> (see
     (guile)R6RS Records), otherwise the object will not be added to the
     lost-and-found.
+
+    The lost-and-found to which the losable belongs can be retrieved with the
+    accessor <scm|losable-lost-and-found> \V however, when called on an
+    object of a subtype <scm|\<less\>losable\<gtr\>>, this is only supposed
+    to be done by the implementation of the subtype, such that the
+    implementation can assume it is the only party that adds or retrieves to
+    or from the lost-and-found.
   </explain>
 
   <\example>
diff --git a/gnu/gnunet/concurrency/lost-and-found.scm 
b/gnu/gnunet/concurrency/lost-and-found.scm
index 7465e7d..4d3be1f 100644
--- a/gnu/gnunet/concurrency/lost-and-found.scm
+++ b/gnu/gnunet/concurrency/lost-and-found.scm
@@ -19,7 +19,7 @@
 ;; Author: Maxime Devos
 (define-library (gnu gnunet concurrency lost-and-found)
   (export make-lost-and-found lost-and-found? collect-lost-and-found-operation
-         make-losable <losable> losable?
+         make-losable <losable> losable? losable-lost-and-found
          ;; exported for tests
          (rename (add-found! #{ add-found!}#)))
   (import (only (rnrs base)
@@ -218,7 +218,7 @@ wakeups where the empty list is returned are possible."
 
     ;; TODO: test the 'lost-and-found=#false' case.
     (define-record-type (<losable> make-losable losable?)
-      (fields (immutable lost-and-found losable-lost-and-found))
+      (fields (immutable lost-and-found %losable-lost-and-found))
       (sealed #false)
       (protocol (lambda (%make)
                  (lambda (lost-and-found)
@@ -228,6 +228,14 @@ wakeups where the empty list is returned are possible."
                        (*guard* object))
                      object)))))
 
+    (define (losable-lost-and-found losable)
+      "Retrieve the ‘lost and found’ to which @var{losable} belongs, if any.
+In case that @var{losable} is of a subtype of @var{<losable>}, it is only
+supposed to be used by the implementation of that subtype, unless documented
+otherwise.  TODO: would be nice if there was a simple way to encode that in the
+code ..."
+      (%losable-lost-and-found losable))
+
     (define (collect-lost)
       (define object (*guard*))
       (when object
diff --git a/tests/utils.scm b/tests/utils.scm
index 47875a0..fb41ef3 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -234,6 +234,11 @@ callbacks were not called.  Also verify that all spawned 
fibers exit."
 the service daemon is down.  Verify that the @var{connected} and
 @var{disconnected} callbacks were not called.  Also verify that all spawned
 fiber exit and the fibers do not keep a reference to the service object."
+  (when (eq? connect (@ (guile) connect))
+    ;; This has happened in the past.  Let's make the test failure more
+    ;; more informative, to avoid having to spend time on investigating
+    ;; this in the future.
+    (error "you passed Guile's connect procedure, not connect procedure for 
connecting to the GNUnet service!"))
   (define (test)
     (call-with-spawner/wait
      (lambda (spawn)

-- 
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]