|
cortex 0.0.1
|
Handle to a spawned fiber that returns a value. More...
#include <future.hpp>
Public Member Functions | |
| Future (const Future &)=delete | |
| Future & | operator= (const Future &)=delete |
| Future (Future &&other) noexcept | |
| Future & | operator= (Future &&other) noexcept |
| ~Future () | |
| void | Wait () |
| Block current fiber until this fiber completes. | |
| T | Get () |
| Block until fiber completes and return the result. | |
| bool | IsReady () const noexcept |
| Check if the fiber has completed. | |
Friends | |
| template<typename U > | |
| Future< U > | Spawn (std::function< U()> func) |
| template<typename U > | |
| Future< U > | Spawn (std::function< U()> func, std::size_t stack_size) |
| template<typename F > | |
| auto | Spawn (F &&func) -> Future< std::invoke_result_t< F > > |
| Spawn a new fiber. | |
| template<typename F > | |
| auto | Spawn (F &&func, std::size_t stack_size) -> Future< std::invoke_result_t< F > > |
| Spawn a new fiber with custom stack size. | |
Handle to a spawned fiber that returns a value.
| T | The return type of the fiber. |
|
inlinenoexcept |
|
inline |
|
inline |
Block until fiber completes and return the result.
| Any | exception thrown by the fiber. |
|
inlinenoexcept |
Check if the fiber has completed.
|
delete |
|
inlinenoexcept |
|
inline |
Block current fiber until this fiber completes.
Spawn a new fiber.
| func | The function to execute in the fiber. |
Spawn a new fiber with custom stack size.
| func | The function to execute in the fiber. |
| stack_size | The stack size for the fiber. |