yield-now

Crates.ioyield-now
lib.rsyield-now
version0.1.0
sourcesrc
created_at2024-08-11 11:08:26.144769
updated_at2024-08-11 11:08:26.144769
descriptionWakes current task and returns Poll::Pending once
homepagehttps://github.com/uskrai/yield-now
repositoryhttps://github.com/uskrai/yield-now.git
max_upload_size
id1333204
size5,285
Muhammad Fathurrohim (Uskrai)

documentation

README

yield-now

Wakes current task and returns [Poll::Pending] once

This function can be used when we want to give task scheduler time to pause before doing some long running task.

this function will use runtime yield_now depending on which feature is enabled

see [tokio::task::yield_now] for tokio

see [async_std::task::yield_now] for async-std

see [futures_lite::future::yield_now] for futures-lite

Examples

use yield_now::yield_now;

yield_now().await;

License: MIT

Commit count: 0

cargo fmt