Skip to content

Commit

Permalink
fix: Run our own async executor on Unix (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
DataTriny authored Jan 10, 2024
1 parent c034802 commit 8f937ba
Show file tree
Hide file tree
Showing 12 changed files with 614 additions and 438 deletions.
10 changes: 2 additions & 8 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions platforms/unix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ edition = "2021"

[features]
default = ["async-io"]
async-io = ["dep:async-channel", "dep:async-lock", "dep:futures-util", "atspi/async-std", "zbus/async-io"]
async-io = ["dep:async-channel", "dep:async-executor", "dep:async-task", "dep:futures-util", "atspi/async-std", "zbus/async-io"]
tokio = ["dep:tokio", "dep:tokio-stream", "atspi/tokio", "zbus/tokio"]

[dependencies]
accesskit = { version = "0.12.2", path = "../../common" }
accesskit_consumer = { version = "0.17.0", path = "../../consumer" }
async-once-cell = "0.5.3"
atspi = { version = "0.19", default-features = false }
futures-lite = "1.13"
once_cell = "1.17.1"
Expand All @@ -27,7 +26,8 @@ zbus = { version = "3.14", default-features = false }

# async-io support
async-channel = { version = "2.1.1", optional = true }
async-lock = { version = "2.7.0", optional = true }
async-executor = { version = "1.5.0", optional = true }
async-task = { version = "4.3.0", optional = true }
futures-util = { version = "0.3.27", optional = true }

# tokio support
Expand Down
7 changes: 7 additions & 0 deletions platforms/unix/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# AccessKit Unix adapter

This is the Unix adapter for [AccessKit](https://accesskit.dev/). It exposes an AccessKit accessibility tree through the AT-SPI protocol.

## Compatibility with async runtimes

While this crate's API is purely blocking, it internally spawns asynchronous tasks on an executor.

- If you use tokio, make sure to enable the `tokio` feature of this crate.
- If you use another async runtime or if you don't use one at all, the default feature will suit your needs.
Loading

0 comments on commit 8f937ba

Please sign in to comment.