-
|
Hello, I am trying to understand the async_comput example, specifically the lines below: ) {
for (entity, mut task) in &mut transform_tasks {
if let Some(transform) = future::block_on(future::poll_once(&mut task.0)) {Since we are in a system, I would expect this code to do a non blocking poll, but the Kind regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
It doesn't block, |
Beta Was this translation helpful? Give feedback.
-
|
Ok, this is what I expected. |
Beta Was this translation helpful? Give feedback.
It doesn't block,
future::poll_oncemeans that the future will complete immediately when.awaited orblock_oned, assuming the future is well-behaved. The code here just checks to see if the future is done, and consumes the output if it is.