Function spin_once

Source
pub async fn spin_once()
Expand description

A function that can be awaited once before it returns; useful to cooperatively give up a timeslice to the runtime/other pending futures

ยงBehaviour

Awaiting this function will immediately wake the waker again and yield, making room for other futures to execute. This is useful for e.g. running intensive loops or similar inside a future.