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

Fix async-std and re-enable Ci for async-std builds #327

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
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 @@
}
// 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 @@
}
// 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
Loading