.\" Automatically generated by Pandoc 2.17.1.1 .\" .TH "FUTURE_POLL" "3" "2022-09-04" "MINIASYNC - miniasync version 0.2.1" "MINIASYNC Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2020-2022, Intel Corporation .SH NAME .PP \f[B]future_poll\f[R]() - poll the future .SH SYNOPSIS .IP .nf \f[C] #include enum future_state; struct future; struct future_notifier; enum future_state future_poll(struct future *fut, struct future_notifier *notifier); \f[R] .fi .PP For general description of future API, see \f[B]miniasync_future\f[R](7). .SH DESCRIPTION .PP The \f[B]future_poll\f[R]() function makes implementation-defined operation towards completion of the task associated with the future pointed by \f[I]fut\f[R]. .PP Additionally, the \f[B]future_poll\f[R]() function can accept future notifier. Future notifier \f[I]notifier\f[R] is an optional parameter that is passed to the future task function. Future notifiers can be used to notify the caller that some progress can be made and the future should be polled again. This can be used to avoid busy polling. .SS RETURN VALUE .PP The \f[B]future_poll\f[R]() function returns current state of the future. .PP Future can be in one of the following states: .IP \[bu] 2 \f[B]FUTURE_STATE_IDLE\f[R] - future task has yet to begin execution .IP \[bu] 2 \f[B]FUTURE_STATE_RUNNING\f[R] - future task is in progress .IP \[bu] 2 \f[B]FUTURE_STATE_COMPLETE\f[R] - future task was completed .SH SEE ALSO .PP \f[B]miniasync\f[R](7), \f[B]miniasync_future\f[R](7) and \f[B]\f[R]