Skip to content

Commit

Permalink
Fix async-std and re-enable Ci for async-std builds
Browse files Browse the repository at this point in the history
  • Loading branch information
slawlor committed Jan 23, 2025
1 parent a4f92a8 commit 231499d
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 68 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,27 @@ jobs:
- name: Run the default tests
package: ractor
# flags:
- name: Test ractor without async-trait
- name: Test ractor with async-trait
package: ractor
flags: --no-default-features -F tokio_runtime,message_span_propogation
flags: -F async-trait
- name: Test ractor without span propogation
package: ractor
flags: --no-default-features -F tokio_runtime,async-trait
flags: --no-default-features -F tokio_runtime
- name: Test ractor with the `cluster` feature
package: ractor
flags: -F cluster
- name: Test ractor with the `blanket_serde` feature
package: ractor
flags: -F blanket_serde
- name: Test ractor with async-std runtime
package: ractor
flags: --no-default-features -F async-std,message_span_propogation
- name: Test ractor with async-std runtime but no span propagation
package: ractor
flags: --no-default-features -F async-std
- name: Test ractor with async-std runtime and async-trait
package: ractor
flags: --no-default-features -F async-std,async-trait
- name: Test ractor_cluster with native async traits
package: ractor_cluster
# flags:
Expand Down
2 changes: 1 addition & 1 deletion ractor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ractor"
version = "0.14.6"
version = "0.14.7"
authors = ["Sean Lawlor", "Evan Au", "Dillon George"]
description = "A actor framework for Rust"
documentation = "https://docs.rs/ractor"
Expand Down
36 changes: 28 additions & 8 deletions ractor/src/actor/supervision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,20 @@ impl SupervisionTree {
}
// drain the tasks
while let Some(res) = js.join_next().await {
match res {
Err(err) if err.is_panic() => std::panic::resume_unwind(err.into_panic()),
Err(err) => panic!("{err}"),
_ => {}
#[cfg(feature = "async-std")]
{
match res {
Err(_) => panic!("JoinSet join error"),
_ => {}
}
}
#[cfg(not(feature = "async-std"))]
{
match res {
Err(err) if err.is_panic() => std::panic::resume_unwind(err.into_panic()),
Err(err) => panic!("{err}"),

Check warning on line 148 in ractor/src/actor/supervision.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/supervision.rs#L146-L148

Added lines #L146 - L148 were not covered by tests
_ => {}
}
}
}
}
Expand All @@ -155,10 +165,20 @@ impl SupervisionTree {
}
// drain the tasks
while let Some(res) = js.join_next().await {
match res {
Err(err) if err.is_panic() => std::panic::resume_unwind(err.into_panic()),
Err(err) => panic!("{err}"),
_ => {}
#[cfg(feature = "async-std")]
{
match res {
Err(_) => panic!("JoinSet join error"),
_ => {}
}
}
#[cfg(not(feature = "async-std"))]
{
match res {
Err(err) if err.is_panic() => std::panic::resume_unwind(err.into_panic()),
Err(err) => panic!("{err}"),

Check warning on line 179 in ractor/src/actor/supervision.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/supervision.rs#L177-L179

Added lines #L177 - L179 were not covered by tests
_ => {}
}
}
}
}
Expand Down
Loading

0 comments on commit 231499d

Please sign in to comment.