userver: clients::http::ResponseFuture Class Reference
Loading...
Searching...
No Matches
clients::http::ResponseFuture Class Referencefinal

#include <userver/clients/http/response_future.hpp>

Detailed Description

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
 
ResponseFutureoperator= (ResponseFuture &&) noexcept
 
 ResponseFuture (const ResponseFuture &)=delete
 
ResponseFutureoperator= (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< ResponseGet (utils::impl::SourceLocation location=utils::impl::SourceLocation::Current())
 Wait for the response and return it.
 
void SetCancellationPolicy (CancellationPolicy cp)
 

Member Function Documentation

◆ Wait()

std::future_status clients::http::ResponseFuture::Wait ( utils::impl::SourceLocation  location = utils::impl::SourceLocation::Current())

Stops the current task execution until the request finishes.

Exceptions
clients::http::CancelExceptionif the current task is being cancelled
Returns
std::future_status::ready or std::future_status::timeout

The documentation for this class was generated from the following file: