Skip to content
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

rt: update to actix-rt v2 #1022

Merged
merged 2 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [[#976]] Remove the `Done` trait. The `.rows_affected()` method is now available as an inherent
method on `PgQueryResult`, `MySqlQueryResult` and so on. [[@jplatte]]

- [[#983]] Upgrade async runtime dependencies [[@seryl], [@ant32], [@jplatte]]
- [[#983]] [[#1022]] Upgrade async runtime dependencies [[@seryl], [@ant32], [@jplatte], [@robjtede]]

- tokio 1.0
- actix-rt 2.0

- [[#1007]] Remove `any::AnyType` [[@jplatte]]

[#983]: https://github.com/launchbadge/sqlx/pull/983
[#1022]: https://github.com/launchbadge/sqlx/pull/1022

## 0.4.2 - 2020-12-19

- [[#908]] Fix `whoami` crash on FreeBSD platform [[@fundon]] [[@AldaronLau]]
Expand Down Expand Up @@ -782,3 +785,6 @@ Fix docs.rs build by enabling a runtime feature in the docs.rs metadata in `Carg
[@dstoeckel]: https://github.com/dstoeckel
[@mrcd]: https://github.com/mrcd
[@dvermd]: https://github.com/dvermd
[@seryl]: https://github.com/seryl
[@ant32]: https://github.com/ant32
[@robjtede]: https://github.com/robjtede
41 changes: 3 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sqlx-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub fn test(_attr: TokenStream, input: TokenStream) -> TokenStream {
#[test]
#(#attrs)*
fn #name() #ret {
::sqlx_rt::actix_rt::System::new("sqlx-test")
::sqlx_rt::actix_rt::System::new()
.block_on(async { #body })
}
}
Expand Down
5 changes: 2 additions & 3 deletions sqlx-rt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runtime-async-std-rustls = ["_rt-async-std", "_tls-rustls", "async-rustls"]
runtime-tokio-rustls = ["_rt-tokio", "_tls-rustls", "tokio-rustls"]

# Not used directly and not re-exported from sqlx
_rt-actix = ["actix-rt", "actix-threadpool", "tokio", "once_cell"]
_rt-actix = ["actix-rt", "tokio", "once_cell"]
_rt-async-std = ["async-std"]
_rt-tokio = ["tokio", "once_cell"]
_tls-native-tls = ["native-tls"]
Expand All @@ -29,8 +29,7 @@ _tls-rustls = []
[dependencies]
async-native-tls = { version = "0.3.3", optional = true }
async-rustls = { version = "0.2.0", optional = true }
actix-rt = { version = "=2.0.0-beta.2", default-features = false, optional = true }
actix-threadpool = { version = "0.3.2", optional = true }
actix-rt = { version = "2.0.0", default-features = false, optional = true }
async-std = { version = "1.7.0", features = ["unstable"], optional = true }
tokio-native-tls = { version = "0.3.0", optional = true }
tokio-rustls = { version = "0.22.0", optional = true }
Expand Down
10 changes: 5 additions & 5 deletions sqlx-rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ macro_rules! blocking {
//

#[cfg(feature = "_rt-actix")]
pub use {actix_rt, actix_threadpool};
pub use actix_rt;

#[cfg(all(
feature = "_rt-actix",
Expand All @@ -123,10 +123,10 @@ pub use {actix_rt, actix_threadpool};
#[macro_export]
macro_rules! blocking {
($($expr:tt)*) => {
$crate::actix_threadpool::run(move || { $($expr)* }).await.map_err(|err| match err {
$crate::actix_threadpool::BlockingError::Error(e) => e,
$crate::actix_threadpool::BlockingError::Canceled => panic!("{}", err)
})
// spawn_blocking is a re-export from tokio
$crate::actix_rt::task::spawn_blocking(move || { $($expr)* })
.await
.expect("Blocking task failed to complete.")
};
}

Expand Down