-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Upgrade to Tokio 1.0 #664
Upgrade to Tokio 1.0 #664
Conversation
Rebased and ready for review |
CI fails due to spurious old clippy lints that just showed up out of the blue. #665 filed to fix this |
[PR #664]'s CI failed due to [Clippy erroring] on some lints that are new with Rust 1.49. [Clippy erroring]: https://github.com/twilight-rs/twilight/runs/1630617881 [PR #664]: #664 Approved-by: BlackHoleFox <blackholefoxdev@gmail.com> Approved-by: Cassandra McCarthy <cassie@7596ff.com> Merged-by: Vivian Hellyer <vivian@hellyer.dev> Signed-off-by: Vivian Hellyer <vivian@hellyer.dev>
[PR #664]'s CI failed due to [Clippy erroring] on some lints that are new with Rust 1.49. [Clippy erroring]: https://github.com/twilight-rs/twilight/runs/1630617881 [PR #664]: #664 Approved-by: BlackHoleFox <blackholefoxdev@gmail.com> Approved-by: Cassandra McCarthy <cassie@7596ff.com> Merged-by: Vivian Hellyer <vivian@hellyer.dev> Signed-off-by: Vivian Hellyer <vivian@hellyer.dev>
Upgrade Tokio to 1.0 as well as all related dependencies. In total, this results in upgrading: - async-tungstenite: 0.11 - hyper: 0.14 - hyper-rustls: 0.22 - hyper-tls: 0.5 - tokio: 1.0 The migration is not very interesting; changing `tokio::time::delay_for`s to `tokio::time:sleep`s and such. Tokio has changed the `rt-core` feature to `rt` and `rt-threaded` to `rt-multi-thread`, so the examples have been updated for this. Notably, due to `tokio::time::throttle` being moved to a separate crate - `tokio-stream` - and working oddly, a thin throttle stream has been manually implemented. Blocks on #657. Closes #649. Signed-off-by: Vivian Hellyer <vivian@hellyer.dev>
Hyper PR (#657) is merged now. PR rebased, squashed, tests pass, and ready to be reviewed. |
Signed-off-by: Vivian Hellyer <vivian@hellyer.dev>
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.
Looks overall good a few small dependency tidbits
Signed-off-by: Vivian Hellyer <vivian@hellyer.dev>
Comments addressed |
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.
LGTM
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.
Changes look good, excited for 0.3 🎉
Upgrade Tokio to 1.0 as well as all related dependencies. In total, this results in upgrading: - async-tungstenite: 0.11 - hyper: 0.14 - hyper-rustls: 0.22 - hyper-tls: 0.5 - tokio: 1.0 The migration is not very interesting; changing `tokio::time::delay_for`s to `tokio::time:sleep`s and such. Tokio has changed the `rt-core` feature to `rt` and `rt-threaded` to `rt-multi-thread`, so the examples have been updated for this. Notably, due to `tokio::time::throttle` being moved to a separate crate - `tokio-stream` - and working oddly, a thin throttle stream has been manually implemented. Closes #649. Approved-by: Jens Reidel <adrian@travitia.xyz> Approved-by: Valdemar Erk <valdemar@erk.io> Merged-by: Vivian Hellyer <vivian@hellyer.dev> Signed-off-by: Vivian Hellyer <vivian@hellyer.dev>
Upgrade Tokio to 1.0 as well as all related dependencies. In total, this results in upgrading: - async-tungstenite: 0.11 - hyper: 0.14 - hyper-rustls: 0.22 - hyper-tls: 0.5 - tokio: 1.0 The migration is not very interesting; changing `tokio::time::delay_for`s to `tokio::time:sleep`s and such. Tokio has changed the `rt-core` feature to `rt` and `rt-threaded` to `rt-multi-thread`, so the examples have been updated for this. Notably, due to `tokio::time::throttle` being moved to a separate crate - `tokio-stream` - and working oddly, a thin throttle stream has been manually implemented. Closes #649. Approved-by: Jens Reidel <adrian@travitia.xyz> Approved-by: Valdemar Erk <valdemar@erk.io> Merged-by: Vivian Hellyer <vivian@hellyer.dev> Signed-off-by: Vivian Hellyer <vivian@hellyer.dev>
Version 0.3 has been released with the primary intent to switch from `reqwest` to the lighter `hyper` as the HTTP client and upgrade to Tokio 1.0. Upgrade Path `client::Client`'s `delete_webhook_from_url`, `execute_webhook_from_url`, `update_webhook_from_url`, and `update_webhook_with_token_from_url` methods have been removed. Instead, use the `twilight-util` crate's new `link::webhook::parse` functionality to parse webhook IDs and tokens out of URLs. Then, pass the webhook ID and token to the method variants without `_from_url`; for example, `client::Client::execute_webhook`. `client::Client::add_role` has been removed because it was a duplicate method. Instead use `client::Client::add_guild_member_role`. When attaching files to a message, pass in the bytes of the attachment instead of `reqwest`'s `Body` type. If supplying an HTTP client to `twilight-http`, pass a `hyper` client instead of a `reqwest` client and use `client::ClientBuilder::hyper_client` instead of `reqwest_client`. Instead of using `client::ClientBuilder::proxy` to pass a `reqwest` proxy, use it to pass a string of the URL of the proxy. This is now specifically noted to be used with applications like Twilight's `http-proxy` instead of connecting to a proxy, which can be configured with a manual `hyper` client. `error::UrlError`'s `UrlParsing` variant has been removed as it can no longer occur. `error::Error`'s `BuildingClient` has been removed as building clients can no longer fail. All Weqwest errors are now `hyper` errors. A couple of re-exports have been removed. Use `twilight_model::user::CurrentUserGuild` instead of `request::user::get_current_user_guilds::CurrentUserGuild`. Additionally, use `request::channel::allowed_mentions` instead of `request::channel::message::allowed_mentions`. Remove old re-exports that were deprecated in v0.2 ([#673] - [@vivian]). Upgrade from `tokio` v0.2 to v1 ([#664] - [@vivian]). `reqwest` has been switched out for `hyper` 0.14. With this comes some API breakage: - `client::ClientBuilder::build` no longer returns a `Result` - `client::ClientBuilder::reqwest_client` has been renamed to `hyper_client` - `client::ClientBuilder::{proxy_http, proxy}` have been combined into `proxy` - `client::Client::raw` now returns a `hyper` response instead of a `reqwest` response - `error::Error::BuildingClient` has been removed - `error::Error::{ChunkingResponse, RequestError}` now include `hyper` source errors instead of `reqwest` ones - `request::channel::message::CreateMessage::attachment{,s}` now takes `impl Into<Vec<u8>>` instead of `impl Into<reqwest::Body>` ([#657] - [@vivian], [#670] - [@Gelbpunkt]). Remove `client::Client::add_role` ([#669] - [@vivian]). Remove webhook URL variant client methods and move webhook URL parsing to `twilight-util` ([#658] - [@vivian]). [@Gelbpunkt]: https://github.com/Gelbpunkt [@vivian]: https://github.com/vivian [#673]: #673 [#670]: #670 [#669]: #669 [#664]: #664 [#658]: #658 [#657]: #657 Signed-off-by: Vivian Hellyer <vivian@hellyer.dev>
Version 0.3 has been released with the primary intent to upgrade to Tokio 1.0. Upgrade Path When using `shard::Sink` pass in the new `shard::raw_message::Message` type instead of `tungstenite::Message`. This is mostly equivalent to `tungstenite`'s message but prevents exposing it directly, which avoids API breakage when upgrading internal websocket dependencies. Changes Hide the `tungstenite` dependency from the public API by creating an equivalent to a websocket message that can be constructed and passed in ([#667] - [@vivian]). Upgrade `tokio` from v0.2 to v1 ([#664] - [@vivian]). [@vivian]: https://github.com/vivian [#667]: #667 [#664]: #664 Signed-off-by: Vivian Hellyer <vivian@hellyer.dev>
Upgrade Tokio to 1.0 as well as all related dependencies. In total, this results in upgrading:
The migration is not very interesting; changing
tokio::time::delay_for
s totokio::time:sleep
s and such. Tokio has changed thert-core
feature tort
andrt-threaded
tort-multi-thread
, so the examples have been updated for this.Notably, due to
tokio::time::throttle
being moved to a separate crate -tokio-stream
- and working oddly, a thin throttle stream has been manually implemented.Blocks on #657.
Closes #649.