Skip to content

Commit 3fbc4eb

Browse files
Jwashtonsdroege
authored andcommitted
Adjust install of ashpd to avoid tokio
Since version 0.10 `ashpd` has shipped with the `tokio` feature enabled by default. This slightly undermines this section of the book where the author is discussing non-tokio ways to run async code. This commit adjusts the command for adding `ashpd` to exclude `tokio` and use the previously expected `async-std` feature instead. Without this change, the example code compiles but panics with a `there is no reactor running` message. With this change, the example code runs successfully.
1 parent 7cef311 commit 3fbc4eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/src/main_event_loop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ Filename: <a class=file-link href="https://github.com/gtk-rs/gtk4-rs/blob/main/b
210210
Asynchronous functions from the `glib` ecosystem can always be spawned on the `glib` main loop.
211211
Typically, crates depending on `async-std` or `smol` work as well.
212212
Let us take `ashpd` for example which allows sandboxed applications to interact with the desktop.
213-
Per default it depends on `async-std`.
213+
It can be configured to depend on `async-std`.
214214
We can add it to our dependencies by running the following command.
215215

216216
```
217-
cargo add ashpd --features gtk4
217+
cargo add ashpd --no-default-features --features "gtk4 async-std"
218218
```
219219

220220
You need to use a Linux desktop environment in order to run the following example locally.

0 commit comments

Comments
 (0)