docs: add docs describing how CoreCryptoCancellationToken works - #2356
Merged
Conversation
SimonThormeyer
force-pushed
the
simon/docs/cancellation-token
branch
2 times, most recently
from
July 21, 2026 12:30
506851a to
91f376a
Compare
CoreCryptoCancellationToken works.CoreCryptoCancellationToken works
SimonThormeyer
force-pushed
the
simon/docs/cancellation-token
branch
from
July 21, 2026 12:31
91f376a to
899ceb5
Compare
istankovic
reviewed
Jul 24, 2026
| //! [crate::CoreCryptoFfi::transaction_ffi_cancellable] ensures that this constraint isn't violated by only filling the | ||
| //! slot after the transaction semaphore was acquired. *This constraint makes the [CancellationSlot] currently only | ||
| //! usable in transactions*. | ||
| //! The slot is cloned to this crate's structs implementing foreign traits, currently [crate::MlsTransport] and |
Member
There was a problem hiding this comment.
What does it mean to "clone the slot to this crate's structs"? Did you mean "add" instead of "clone"?
istankovic
reviewed
Jul 24, 2026
| //! To make a future cancellable, we race the future against [CoreCryptoCancellationToken::cancelled] using | ||
| //! [futures_util::select_biased], with a bias for [CoreCryptoCancellationToken::cancelled] - in case both futures | ||
| //! complete at the same time, cancellation is preferred. If cancellation wins, we return an appropriate error. | ||
| //! |
Member
There was a problem hiding this comment.
This already helps quite a bit, but I think we can go one step further and really make things clear by outlining the sequence of steps that occur, both on the Rust side and the foreign language side.
IOW, something like a sequence diagram would be helpful to show when tokens are created, when the slots are filled, when the guards are dropped etc.
SimonThormeyer
force-pushed
the
simon/docs/cancellation-token
branch
4 times, most recently
from
July 27, 2026 08:18
c406744 to
168a651
Compare
coriolinus
approved these changes
Jul 27, 2026
coriolinus
left a comment
Contributor
There was a problem hiding this comment.
Nice work with the diagram!
SimonThormeyer
force-pushed
the
simon/docs/cancellation-token
branch
from
July 28, 2026 13:10
168a651 to
0aff81f
Compare
Including a sequence diagram.
SimonThormeyer
force-pushed
the
simon/docs/cancellation-token
branch
from
July 28, 2026 13:10
0aff81f to
9da73f2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
see above