userver: clients::http::ResponseFuture Class Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
clients::http::ResponseFuture Class Referencefinal

Your opinion will help to improve our service

Leave a feedback >

#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 29 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 ()
 Stops the current task execution until the request finishes.
 
std::shared_ptr< ResponseGet ()
 Wait for the response and return it.
 
void SetCancellationPolicy (CancellationPolicy cp)
 

Member Function Documentation

◆ Wait()

std::future_status clients::http::ResponseFuture::Wait ( )

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: