#include <userver/drivers/subscribable_futures.hpp>
An adaptor for working with certain external futures.
The SubscribableFuture
must have a Subscribe(Callback)
method that calls the callback when the future is ready. If the future is already ready, then Subscribe
must call the callback immediately. If the promise is dropped and will never be fulfilled properly, then the SubscribableFuture
should call the callback anyway.
Definition at line 41 of file subscribable_futures.hpp.
Public Member Functions | |
SubscribableFutureWrapper (SubscribableFuture &&future) | |
SubscribableFuture & | GetFuture () |
void | Wait () |
Wait for the future. The result can be retrieved from the original future using GetFuture once ready. | |
engine::FutureStatus | TryWaitUntil (engine::Deadline deadline) |
Wait for the future. The result can be retrieved from the original future using GetFuture once ready. | |
|
inlineexplicit |
Definition at line 43 of file subscribable_futures.hpp.
|
inline |
Definition at line 50 of file subscribable_futures.hpp.
|
inline |
Wait for the future. The result can be retrieved from the original future using GetFuture once ready.
Definition at line 64 of file subscribable_futures.hpp.
|
inline |
Wait for the future. The result can be retrieved from the original future using GetFuture once ready.
engine::WaitInterruptedException | on task cancellation |
Definition at line 55 of file subscribable_futures.hpp.