I’m learning to use hyper which uses futures to allow async I/O. I want to embrace that concept, but am having a hard time understanding how to work with it, or what its implications are. I’m not even entirely sure how to express my confusion, so bear with me.
Service trait has a function
call that handles HTTP requests and returns a future. If one of these calls triggered a computation that’s either expensive or high latency, do I understand it right that this would block the whole server? In other words, do I need to package time-intensive, nested computations into some iterative logic (implementing the
Future trait) and return
Async::NotReady, and the event loop will automagically revisit these nested futures until they’ve completed?
I read a lot of documentation on this, so I think a dialog with another human is my last hope.