You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is this task and why do we need to work on it?
The network task does this:
let direct_handle = async_spawn(async move {
loop {
let msgs = match network.recv_msgs(TransmitType::Direct).await {
Ok(msgs) => Messages(msgs),
Err(err) => {
error!("failed to receive direct messages: {err}");
// return zero messages so we sleep and try again
Messages(vec![])
}
};
if msgs.0.is_empty() {
async_sleep(Duration::from_millis(100)).await;
} else {
state.handle_messages(msgs.0).await;
}
}
});
Ideally recv_messages would not be able to return an empty vector.
Sadly the web server implementation uses locked vectors for it's message queues so we can't simply await for the next message, we have to periodically check the queue.
What work will need to be done to complete this task?
Either simply remove the sleep case and just await in a loop when we get rid of the webserver, or fix the webserver impl to use channels where it should.
Are there any other details to include?
No response
What are the acceptance criteria to close this issue?
No sleeps in this code
Branch work will be merged to (if not the default branch)
No response
The text was updated successfully, but these errors were encountered:
What is this task and why do we need to work on it?
The network task does this:
Ideally
recv_messages
would not be able to return an empty vector.Sadly the web server implementation uses locked vectors for it's message queues so we can't simply
await
for the next message, we have to periodically check the queue.What work will need to be done to complete this task?
Either simply remove the sleep case and just await in a loop when we get rid of the webserver, or fix the webserver impl to use channels where it should.
Are there any other details to include?
No response
What are the acceptance criteria to close this issue?
No sleeps in this code
Branch work will be merged to (if not the default branch)
No response
The text was updated successfully, but these errors were encountered: