Skip to content

Commit 368bef5

Browse files
committed
Minimal optimization for cap-async-std.
Use `spawn_blocking` to run important blocking tests off the main thread.
1 parent afdd09b commit 368bef5

File tree

15 files changed

+723
-266
lines changed

15 files changed

+723
-266
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ publish = false
1818
rustc_version = "0.3.0"
1919

2020
[dev-dependencies]
21-
async-std = { version = "1.8.0", features = ["attributes"] }
21+
# Use a git dependency until https://github.com/async-rs/async-std/pull/937 is released.
22+
async-std = { git = "https://github.com/async-rs/async-std", features = ["attributes"] }
2223
anyhow = "1.0.37"
2324
cap-async-std = { path = "cap-async-std", version = "^0.9.1-alpha.0"}
2425
cap-fs-ext = { path = "cap-fs-ext", version = "^0.9.1-alpha.0"}

cap-async-std/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ readme = "README.md"
1515

1616
[dependencies]
1717
arf-strings = { version = "0.3.0", optional = true }
18-
async-std = { version = "1.8.0", features = ["attributes"] }
18+
# Enable "unstable" for `spawn_blocking`.
19+
# Use a git dependency until https://github.com/async-rs/async-std/pull/937 is released.
20+
async-std = { git = "https://github.com/async-rs/async-std", features = ["attributes", "unstable"] }
1921
cap-primitives = { path = "../cap-primitives", version = "^0.9.1-alpha.0"}
20-
unsafe-io = "0.1.0"
22+
unsafe-io = "0.2.0"
2123

2224
[badges]
2325
maintenance = { status = "actively-developed" }

cap-async-std/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,5 @@
1515
This crate provides a capability-oriented version of [`async-std`]. See the
1616
[toplevel README.md] for more information about capability-oriented security.
1717

18-
At the moment, `cap-async-std` is a very rudimentary translation of [`cap-std`] to
19-
`async-std`. It hasn't yet been optimized to make effective use of `async`.
20-
2118
[`async-std`]: https://crates.io/crates/async-std
22-
[`cap-std`]: https://github.com/bytecodealliance/cap-std/blob/main/cap-std/README.md
2319
[toplevel README.md]: https://github.com/bytecodealliance/cap-std/blob/main/README.md

0 commit comments

Comments
 (0)