-
Notifications
You must be signed in to change notification settings - Fork 147
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
Add gloo-net crate #191
Merged
Merged
Add gloo-net crate #191
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
Fixes: ranile/reqwasm#1
* redo websockets * docs + tests * remove gloo-console * fix CI * Add getters for the underlying WebSocket fields * better API * better API part 2 electric boogaloo
* Update to Rust 2021 and use JsError from gloo-utils * use new toolchain
When the WebSocket is used with frameworks, passed down as props, it might be `drop`ed automatically, which closes the WebSocket connection. Initially `Clone` was added so sender and receiver can be in different `spawn_local`s but it turns out that `StreamExt::split` solves that problem very well. See #13 for more information about the issue
) * feat: feature gate json support * feat: feature gate weboscket api * ci: check websocket and json features seperately in CI, check no default features * feat: feature gate the http API * refactor: use futures-core and futures-sink instead of depending on whole of futures * ci: test http feature seperately in CI * fix: only compile error conversion funcs if either APIs are enabled * fix: add futures to dev-deps for tests, fix doc test
* Change edition from 2021 to 2018 * Fix missing import due to edition 2021 prelude
We no longer need a multi-producer-multi-consumer channel. There's only one consumer as of ranile/reqwasm@445e9a5
The websocket specification guarantees that messages are received in the same order they are sent. The implementation in this library can violate this guarantee because messages are parsed in a spawn_local block before being sent over the channel. When multiple messages are received before the next executor tick the scheduling order of the futures is unspecified. We fix this by performing all operations synchronously. The only part where async is needed is the conversion of Blob to ArrayBuffer which we obsolete by setting the websocket to always receive binary data as ArrayBuffer.
…oo-reqwasm This merge is done to move reqwasm crate to gloo. This puts reqwasm under the gloo umbrella. See #188 (comment) for need of this merge.
ranile
force-pushed
the
gloo-reqwasm
branch
2 times, most recently
from
February 15, 2022 14:21
64453ba
to
1832554
Compare
Merged
ranile
added a commit
to ranile/reqwasm
that referenced
this pull request
Mar 11, 2022
See the updated README for future plans. All the code from reqwasm was was moved to gloo as part of rustwasm/gloo#191. Move to gloo-net should be a drop-in replacement for reqwasm users
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.
This PR adds a new crate,
gloo-net
, which has been missing for quite a while. This is done by merging my crate, reqwasm into gloo as gloo-net.Unlike the last crate introduced in #180, I was able to keep the git history intact. I learnt that it was possible only recently. I apologize to all the contributors who had their history lost as part of merge done in #180
Fixes #4
Fixes #49
Closes #113
Supersedes #188
Allows following to move forward:
AsyncRead
/AsyncWrite
ranile/reqwasm#6)