How to handle blocking calls in a handler? #438
Unanswered
overthetop
asked this question in
Q&A
Replies: 1 comment 3 replies
-
ntex uses runtime’s blocking system. for example for tokio ntex uses spawn_blocking you need to check target runtime docs |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey all
What is the best practice to handle blocking calls in a http handler?
Is this the way to do it https://github.com/ntex-rs/examples/blob/a3cb7646348f0ba25efffc639125eec766860368/async_db/src/db.rs#L49 using web.block( .... )? I suppose that is using another thread pool. How can I configure the number of threads that handle blocking calls? Please correct me and explain in case I'm wrong.
Beta Was this translation helpful? Give feedback.
All reactions