Future
final class Future (View source)
A Future represents the return value or uncaught exception from a task, and exposes an API for cancellation.
The behaviour of a future also allows it to be used as a simple synchronization point even where the task does not return a value explicitly.
Methods
Shall return (and if necessary wait for) return from task
Shall indicate if the task is completed
Shall indicate if the task was cancelled
Shall try to cancel the task Note: If task is running, it will be interrupted.
Details
mixed
value()
Shall return (and if necessary wait for) return from task
bool
done()
Shall indicate if the task is completed
bool
cancelled()
Shall indicate if the task was cancelled
bool
cancel()
Shall try to cancel the task Note: If task is running, it will be interrupted.
Warning: Internal function calls in progress cannot be interrupted.