[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.
- [gnunet-scheme] 154/324: mq: Implement 'inject-error!'., (continued)
- [gnunet-scheme] 154/324: mq: Implement 'inject-error!'., gnunet, 2021/09/21
- [gnunet-scheme] 156/324: mq-impl/stream: Implement on top of ports., gnunet, 2021/09/21
- [gnunet-scheme] 162/324: Merge branch 'proper-mq', gnunet, 2021/09/21
- [gnunet-scheme] 161/324: guix: Patch 'guile' to fix some bugs., gnunet, 2021/09/21
- [gnunet-scheme] 152/324: utils: tokeniser: Implement 'add-from-port!'., gnunet, 2021/09/21
- [gnunet-scheme] 157/324: README.org: Note Guile 3.0.7 cannot be used for compilation., gnunet, 2021/09/21
- [gnunet-scheme] 151/324: utils: tokeniser: Some extra documentation., gnunet, 2021/09/21
- [gnunet-scheme] 153/324: concurrency: repeated-conditions: New module., gnunet, 2021/09/21
- [gnunet-scheme] 158/324: mq-impl/stream: Add modules and tests to 'Makefile.am'., gnunet, 2021/09/21
- [gnunet-scheme] 167/324: README: Graduate 'Message queues' to :test:good:, gnunet, 2021/09/21
- [gnunet-scheme] 146/324: mq: envelope: Allow testing whether an envelope is cancelled.,
gnunet <=
- [gnunet-scheme] 173/324: netstruct/procedural: Support IEEE doubles., gnunet, 2021/09/21
- [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