-
-
Notifications
You must be signed in to change notification settings - Fork 71
feat(socketio): Async adapter #395
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
Merged
Merged
Conversation
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
e922c42
to
c93a125
Compare
c93a125
to
f177f7f
Compare
f177f7f
to
4ec5721
Compare
Closed
* Remove Sync bound on adapter error * Add an AdapterCtr trait to keep state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clippy found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
a66ed7c
to
54fb59a
Compare
54fb59a
to
c0ecf9c
Compare
Closed
c427e34
to
dc0a4ff
Compare
dc0a4ff
to
67bcc99
Compare
6342381
to
a30d2df
Compare
a30d2df
to
db50c6d
Compare
3 tasks
This is already too big, I'm merging this on the branch |
Totodore
added a commit
that referenced
this pull request
Jan 12, 2025
* feat(socketio): async adapter (#395) * feat: improve `Adapter` error types for `broadcast` and `disconnect` methods (#408) * feat(socketio/ns): improve `SocketEmitter` trait (#410) * feat(core/adapter): pass filter to get_sids * feat: add custom `Iterator` return for apply_opts fn * chore(docs): add doc on async adapters (#411) * feat(adapter): add a remote socket API (#412) * feat(core): switch to a new type for server uid (#413) * chore(deps): rm `__test_harness` && `tracing` feature flags. * chore(deps): add fuzzing as cfg flag * chore(ci): msrv * chore(clippy): fix redundant import (#414) * feat(core): improve local adapter perf (#415) * test(e2e): provide e2e testing system for adapters (#422) * test(e2e): provide e2e testing system for adapters * fix(e2e/adapter): remove redis deps * feat(socketio): check namespaces at insertion * feat(redis): redis adapter crate (#402)
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.
Motivation
Transform the
Adapter
trait to returnimpl Future + Send
so that it is possible to implement adapters with other systems (redis, mongo, ...).Solution
Adapter
returnsimpl Future + Send
for all the methods that may need to communicate remotely (e.gemit
,emit_with_ack
on theBroadcastOperators
andSocketIo
structs).socketioxide_core
trait as well as someerror
types. So that new adapters only need to depends onsocketioxide_core
.Packet
andAckError
implementSerialize
in order to send them to remote nodes.ParserError
is now simply a wrapper around aBox<impl StdError>
so that it is easy to implserde
on it. Therefore theDecodeError
andEncodeError
GAT have been removed.State
GAT allow anyAdapter
implementors to share a common state between all adapters of a node. It can be useful to share a connection to a remote server (redis, mongo, ...).AckStream
GAT allow the adapter to merge a stream from the local node with a remote stream of acknowledgments.Remaining questions/issues:
To do:
BroadcastOperators
.