Are Futures blocking the runtime? #223
Unanswered
jonatan-zeidler-bl
asked this question in
Q&A
Replies: 1 comment
|
Turns out that this pattern is really a bug. |
0 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.
Uh oh!
There was an error while loading. Please reload this page.
I tried to find answers in #17, but it doesn't seem to answer my question, nor does the suggestions there seem to match the current API design.
As a user of the zenoh API (or any API), I try to reason about whether a function is
Looking at zenoh types I have a hard time to figure that out. For example, sending a query reply goes through the
ReplyBuilderwhich I need toawaiton. As a Rust developer, this tells me we are in case 2. ii) b), the normal Rust async world. From that I also take it that I am probably waiting for the network to send out the reply, potentially suffering back-pressure (which would be nice to be found documented in the API docs btw).But looking at the implementation, I get a different impression:
with
This reads like the
ReplyBuilderis turned into a directly-ready-future that simply calls synchronous code. Does that mean we are actually in case 1.? If so, why the Future in the first place and what about back-pressure? Or are we in 2. i.? That would be bad news as it would be blocking the Runtime, wouldn't it?All reactions