-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rust client SDK: send SubscribeMulti
and UnsubscribeMulti
#2281
Merged
Conversation
This file contains 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
This commit modifies the Rust client SDK to use the new setwise subscription API. This includes: - Changing `SubscriptionBuilder::subscribe` to accept any implementor of `IntoQueries`, including single strings and also arrays of strings, for various definitions of "string" and "array." And fiddling a bit with the implementations of `IntoQueries`. - Sending the `SubscribeMulti` and `UnsubscribeMulti` websocket messages instead of `Subscribe` and `Unsubscribe`. - Stubbing the handling of `SubscribeApplied` and `UnsubscribeApplied` websocket messages, since those should now be unreachable. - Handling the `SubscribeMultiApplied` and `UnsubscribeMultiApplied` messages instead. - Simplifying the `quickstart-chat` and `test-client` clients to just subscribe to one big set, where previously they had a kind of wonky semaphore-based scheme to wait for all queries to be applied.
a4ccf89
to
dff56a6
Compare
dff56a6
to
a4ccf89
Compare
Attempting to rebase has proved once more to have been a mistake. Merging seems to have worked fine, though. Sorry for the confusion and force-pushes! |
Centril
approved these changes
Feb 21, 2025
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.
Description of Changes
Based on #2278 .
This commit modifies the Rust client SDK to use the new setwise subscription API.
This includes:
SubscriptionBuilder::subscribe
to accept any implementor ofIntoQueries
, including single strings and also arrays of strings, for various definitions of "string" and "array." And fiddling a bit with the implementations ofIntoQueries
.SubscribeMulti
andUnsubscribeMulti
websocket messages instead ofSubscribe
andUnsubscribe
.SubscribeApplied
andUnsubscribeApplied
websocket messages, since those should now be unreachable.SubscribeMultiApplied
andUnsubscribeMultiApplied
messages instead.quickstart-chat
andtest-client
clients to just subscribe to one big set, where previously they had a kind of wonky semaphore-based scheme to wait for all queries to be applied.New syntax
You can now do:
The array passed here may be a
[T; N]
(fixed-size array), a&[T]
(slice),Vec<T>
(vec) for a few different string-likeT
s, or aBox<[Box<str>]>
.You can also still subscribe to a single query without wrapping it in an array, like:
The string here may be
&str
,String
orBox<str>
. These are the same "string-like" types which can be put in arrays as above.API and ABI breaking changes
I have not been super careful about the changed implementations of
IntoQueries
, so minor incompatibilities are possible between our most recent 1.0-rc release and this patch in terms of valid types to pass toSubscriptionBuilder::subscribe
. Common cases, like&str
andString
, still work.Expected complexity level and risk
1
Testing
Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!