gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] 146/324: mq: envelope: Allow testing whether an envelope


From: gnunet
Subject: [gnunet-scheme] 146/324: mq: envelope: Allow testing whether an envelope is cancelled.
Date: Tue, 21 Sep 2021 13:23:06 +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 b31208582b11ca0dd4f2b9cbcd0c91e9b21a6d2d
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sun Jun 20 11:32:18 2021 +0200

    mq: envelope: Allow testing whether an envelope is cancelled.
    
    * gnu/gnunet/envelope.scm (envelope-peek-cancelled?): New procedure.
---
 gnu/gnunet/mq/envelope.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gnu/gnunet/mq/envelope.scm b/gnu/gnunet/mq/envelope.scm
index d36f157..4826722 100644
--- a/gnu/gnunet/mq/envelope.scm
+++ b/gnu/gnunet/mq/envelope.scm
@@ -27,6 +27,7 @@
 (define-library (gnu gnunet mq envelope)
   (export <envelope> make-envelope envelope?
          attempt-cancel! attempt-irrevocable-sent!
+         envelope-peek-cancelled?
          ;; TODO find a better place
          (rename (bind-atomic-boxen %%bind-atomic-boxen)))
   (import (gnu gnunet utils hat-let)
@@ -69,6 +70,10 @@ When being marked as cancelled, the thunk @var{cancel!} is 
called."
           (%make (make-atomic-box
                   (vector message priority notify-sent! cancel!)))))))
 
+    (define (envelope-peek-cancelled? envelope)
+      "Test whether @var{envelope} is currently cancelled (true / false)."
+      (eq? #t (atomic-box-ref (%cancellation-state envelope))))
+
     (define (%attempt-irrevocable-sent! envelope already-sent go cancelled)
       (bind-atomic-boxen
        ((state (%cancellation-state envelope) swap!))

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