Closed
Conversation
Safe because there are no `&self` methods on `Streaming<T>` that access any of its non `Sync` members. Fixes hyperium#81
Member
|
So I'm not sure this is the correct approach, we should instead add them via bounds. |
Member
|
done in #84 thank you for the help <3 |
brentalanmiller
pushed a commit
to brentalanmiller/tonic
that referenced
this pull request
Oct 6, 2023
github-merge-queue bot
pushed a commit
to linera-io/linera-protocol
that referenced
this pull request
Jun 4, 2025
## Motivation Currently we have a lot of implementations in `linera-views` that don't work on the Web because they require `Sync` bounds. For example, `MapView` and `QueueView` are not usable on the Web. ## Proposal Conditionally use `trait-variant` to add bounds to the traits themselves rather than the implementations. [Futures should ‘always’ be `Sync`](https://internals.rust-lang.org/t/what-shall-sync-mean-across-an-await/12020/18) anyway. `linera_storage_service::client` contains an implementation of `KeyValueStore` that is not `Sync` even though it isn't on the Web, due to a trait object inside `tonic` that [has](hyperium/tonic#81) [caused](hyperium/tonic#82) [some](hyperium/tonic#84) [contention](hyperium/tonic#117). For that implementation, follow the solution [given there](hyperium/tonic#117 (comment)) and use [`sync_wrapper::SyncFuture`](https://docs.rs/sync_wrapper/latest/sync_wrapper/struct.SyncFuture.html) to make the futures `Sync` based on the fact that they can only be used through `Pin<&mut Self>` anyway. Ditto `aws-smithy-async`. ## Test Plan CI. ## Release Plan - Nothing to do / These changes follow the usual release cycle. ## Links - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
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.
Safe because there are no
&selfmethods onStreaming<T>that access any of its nonSyncmembers.Fixes #81
Closes #84