poll-promise is a Rust crate for polling the result of a concurrent (e.g. async) operation.
It is particularly useful in games and immediate mode GUI:s, where one often wants to start a background operation and then ask "are we there yet?" on each subsequent frame until the operation completes.
Example:
#
# use Promise;
#
let promise = spawn_thread;
// Then in the game loop or immediate mode GUI code:
if let Some = promise.ready else
If you enable the tokio feature you can use poll-promise with the tokio
runtime to run async tasks using [Promise::spawn_async] and [Promise::spawn_blocking].