#include <userver/clients/http/response_future.hpp>
Allows to perform a request concurrently with other work without creating an extra coroutine for waiting.
Definition at line 30 of file response_future.hpp.
Public Member Functions | |
ResponseFuture (ResponseFuture &&other) noexcept | |
ResponseFuture & | operator= (ResponseFuture &&) noexcept |
ResponseFuture (const ResponseFuture &)=delete | |
ResponseFuture & | operator= (const ResponseFuture &)=delete |
void | Cancel () |
Cancel the request in flight. | |
void | Detach () |
Keep executing the request but do not care any more about the result. It is fine to destroy this future after Detach(), the request will continue execution. | |
std::future_status | Wait (utils::impl::SourceLocation location=utils::impl::SourceLocation::Current()) |
Stops the current task execution until the request finishes. | |
std::shared_ptr< Response > | Get (utils::impl::SourceLocation location=utils::impl::SourceLocation::Current()) |
Wait for the response and return it. | |
void | SetCancellationPolicy (CancellationPolicy cp) |
std::future_status clients::http::ResponseFuture::Wait | ( | utils::impl::SourceLocation | location = utils::impl::SourceLocation::Current() | ) |
Stops the current task execution until the request finishes.
clients::http::CancelException | if the current task is being cancelled |