Re:How to Learn Modern Rust
by Matthias247 on Monday September 12, 2022 @09:08PM
(#32819531)
Slightly off topic question/comment: You are running an async server, together with a blocking database client? That sounds more like a very tricky place ot get started. Are you dispatching all your database queries into an extra threadpool?
[ Parent
| on HN ]
Re:How to Learn Modern Rust
by throwaway239219 on Monday September 12, 2022 @10:11PM
(#32819995)
Yes, as you have expected tokio has spawn_blocking which allows you to throw misbehaving code into a thread pool.
This started to disgust me so I jumped to sqlx.
Re:How to Learn Modern Rust
by outside1234 on Tuesday September 13, 2022 @10:25AM
(#32824674)
Yes - what throwaway said. Good suggestion as well to use sqlx instead.