zenoh
zenoh copied to clipboard
Avoid hanging when querying a local queryable when using async and flume handlers
Problem: The following example hangs:
let queryable = session
.declare_queryable("test")
.res()
.await
.unwrap();
loop {
select!(
_query = queryable.recv_async() => {},
_ = stdin.read_exact(&mut input).fuse() => {
let replies = session.get("test").res().await.unwrap();
while let Ok(_reply) = replies.recv_async().await {}
return
},
);
}
Proposed solution:
The async get()
resolver should have a specific async implementation that asyncly waits for replies from the replies flume channel.
Note: other resolvers would also benefit from a specific async implementation.