Sets callback which is called once future is resolved (in future)
The function is called only when future is unresolved in time of set.
- Parameters
-
fn | function. The function can return std::coroutine_handke<>, which causes that returned coroutine will be resumed. Other return value is ignored. |
- Return values
-
true | callback has been set, and will be called |
false | callback was not set, because future is already resolved. |
- Note
- There can be only one callback at time
-
There can be only one callback at time. Attempt to call this function twice can cause that previous function is destroyed without calling. However this is way how to replace the callback function before resolution.
Definition at line 617 of file future.h.