10#include <userver/clients/http/config.hpp>
11#include <userver/clients/http/response.hpp>
12#include <userver/compiler/select.hpp>
13#include <userver/engine/deadline.hpp>
14#include <userver/engine/future.hpp>
15#include <userver/engine/impl/context_accessor.hpp>
17USERVER_NAMESPACE_BEGIN
19namespace clients::
http {
29class ResponseFuture
final {
31 ResponseFuture(ResponseFuture&& other)
noexcept;
32 ResponseFuture& operator=(ResponseFuture&&)
noexcept;
33 ResponseFuture(
const ResponseFuture&) =
delete;
34 ResponseFuture& operator=(
const ResponseFuture&) =
delete;
41 std::future_status Wait();
43 std::shared_ptr<Response> Get();
45 void SetCancellationPolicy(CancellationPolicy cp);
49 engine::impl::ContextAccessor* TryGetContextAccessor()
noexcept;
51 ResponseFuture(engine::Future<std::shared_ptr<Response>>&& future,
52 std::shared_ptr<RequestState> request);
56 void CancelOrDetach();
58 engine::Future<std::shared_ptr<Response>> future_;
59 engine::Deadline deadline_;
60 std::shared_ptr<RequestState> request_state_;
61 bool was_deadline_propagated_{
false};
62 CancellationPolicy cancellation_policy_;