-
-
Notifications
You must be signed in to change notification settings - Fork 148
refactor(gateway)!: remove create_* set of functions
#2090
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
Closed
Closed
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
9e1a9c5 to
7c649aa
Compare
7c649aa to
5ce7ec8
Compare
d48f482 to
51a6752
Compare
b94d758 to
901bc18
Compare
55c2d71 to
3943c3b
Compare
3943c3b to
728bd9e
Compare
728bd9e to
58ac7ac
Compare
58ac7ac to
45d9d86
Compare
45d9d86 to
21b1452
Compare
Member
Author
|
I split this PR into multiple commits to ease discussions about whether some of them should be split out into separate PRs |
21b1452 to
48fc517
Compare
7596ff
added a commit
that referenced
this pull request
Feb 4, 2023
Instead of removing these functions entirely, accept a primary `Config`, which is then subsequently optionally modified in the callback. The default config creates the default queue, which is then cloned and re-built before it passed to each shard. It also re-uses the TLS container. Alternative to #2090.
Member
Author
|
Not happening |
7596ff
added a commit
that referenced
this pull request
Feb 5, 2023
…2116) Instead of removing these functions entirely, accept a primary `Config`, which is then subsequently optionally modified in the callback. The default config creates the default queue, which is then cloned and re-built before it passed to each shard. It also re-uses the TLS container. Alternative to #2090. Co-authored-by: Zeyla Hellyer <[email protected]> Co-authored-by: Tim Vilgot Mikael Fredenberg <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
c-all
Affects all crates or the project as a whole
c-book
Affects the book
c-cache
Affects the cache crate
c-gateway
Affects the gateway crate
c-lavalink
Affects the lavalink crate
c-standby
Affects the standby crate
m-breaking change
Breaks the public API.
t-ci
Anything to do with CI.
t-refactor
Refactors APIs or code.
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.
The
create_*set of functions in thestreammodule have a severe quirk, they would not set a shared Queue (users can set one themselves so we can't override it).This PR resolves this pain point by simply removing these functions, which is possible without loosing the TLS reuse optimization as
ConfigimplementsClone. Still, users must be guided to reuse theirConfig, which is why this PR also removes theShard::newfunction, leaving onlyShard::with_configwhich takes aConfig, however, this naming scheme is unusual, so theShard::with_configfunction was also renamed toShard::new.Todo
Provide migration examples from the old (0.14)—belongs in the migration guide insteadShardSchemevariantsConfig, passing that toConfigBuilder::with_configand then building a newConfig