[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 03/05: mq/envelope: Allow testing if the envelope has be
From: |
gnunet |
Subject: |
[gnunet-scheme] 03/05: mq/envelope: Allow testing if the envelope has been sent. |
Date: |
Mon, 22 Aug 2022 22:17:54 +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 99f8d5390d57fad26259496f0eaf171cbcd05a26
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Mon Aug 22 22:05:03 2022 +0200
mq/envelope: Allow testing if the envelope has been sent.
It will be useful for the test coming later.
* gnu/gnunet/mq/envelope.scm (envelope-peek-irrevocably-sent?):
New procedure.
---
gnu/gnunet/mq/envelope.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gnu/gnunet/mq/envelope.scm b/gnu/gnunet/mq/envelope.scm
index e3788af..14d8b66 100644
--- a/gnu/gnunet/mq/envelope.scm
+++ b/gnu/gnunet/mq/envelope.scm
@@ -1,5 +1,5 @@
;; This file is part of GNUnet.
-;; Copyright (C) 2012-2019, 2021 GNUnet e.V.
+;; Copyright © 2012-2019, 2021, 2022 GNUnet e.V.
;;
;; GNUnet is free software: you can redistribute it and/or modify it
;; under the terms of the GNU Affero General Public License as published
@@ -27,6 +27,7 @@
(export <envelope> make-envelope envelope?
attempt-cancel! attempt-irrevocable-sent!
envelope-peek-cancelled?
+ envelope-peek-irrevocably-sent?
;; TODO find a better place
(rename (bind-atomic-boxen %%bind-atomic-boxen)))
(import (gnu gnunet utils hat-let)
@@ -73,6 +74,10 @@ When being marked as cancelled, the thunk @var{cancel!} is
called."
"Test whether @var{envelope} is currently cancelled (true / false)."
(eq? #t (atomic-box-ref (%cancellation-state envelope))))
+ (define (envelope-peek-irrevocably-sent? envelope)
+ "Test whether @var{envelope} has been irrevocably sent (true / false)."
+ (eq? #false (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.
- [gnunet-scheme] branch master updated (d5c2c78 -> 5d04749), gnunet, 2022/08/22
- [gnunet-scheme] 02/05: tests/mq-stream: Yield the current fiber, not the kernel-level thread., gnunet, 2022/08/22
- [gnunet-scheme] 03/05: mq/envelope: Allow testing if the envelope has been sent.,
gnunet <=
- [gnunet-scheme] 05/05: tests/utils: Allow changing fibers defaults in call-with-services/fibers., gnunet, 2022/08/22
- [gnunet-scheme] 01/05: cadet: Document open-channel!., gnunet, 2022/08/22
- [gnunet-scheme] 04/05: tests/cadet: Test the use of the 'allow-send' counter a bit., gnunet, 2022/08/22