Skip to content

Commit 991ea57

Browse files
committed
...
1 parent c02f7e4 commit 991ea57

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

misc/content/2022/12/async-in-rust/async-in-rust.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Status: published
22
Date: 2022-12-04 10:38:16
3-
Modified: 2025-11-11 18:42:02
3+
Modified: 2025-11-23 18:30:54
44
Author: Benjamin Du
55
Slug: async-in-rust
66
Title: Async in Rust
@@ -9,7 +9,14 @@ Tags: Computer Science, programming, Rust, async
99

1010
**Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!**
1111

12-
1. Combining asynchronous code with synchronous code that can cause blocking is never a wise choice.
12+
1. Minimizing usage of async Rust.
13+
Refactor coded as much as possible to be in sync functions,
14+
and have async just be little "router wrappers" for waiting on stuff and feeding it to sync functions.
15+
See good discussion at
16+
[Avoid Async Rust at all costs” - comments from experts?](https://users.rust-lang.org/t/avoid-async-rust-at-all-costs-comments-from-experts/105860)
17+
.
18+
19+
2. Combining asynchronous code with synchronous code that can cause blocking is never a wise choice.
1320
When calling asynchronous code from a synchronous context,
1421
use `futures::executor::block_on` and spawn the async code to a dedicated runtime,
1522
because the former will block the current thread.
@@ -21,6 +28,7 @@ Tags: Computer Science, programming, Rust, async
2128

2229
## Issues in Async Rust
2330

31+
2432
- [Rain: "Cancelling Async Rust" | RustConf 2025](https://www.youtube.com/watch?v=zrv5Cy1R7r4&list=PL2b0df3jKKiRFEuVNk76ufXagOgEJ9sBZ&index=32)
2533

2634
## Tutorials

0 commit comments

Comments
 (0)