5#include <userver/server/http/http_response.hpp>
6#include <userver/server/request/response_base.hpp>
10namespace server::handlers {
14namespace server::
http {
16class ResponseBodyStream
final {
18 ResponseBodyStream(ResponseBodyStream&&) =
default;
19 ~ResponseBodyStream();
23 void PushBodyChunk(std::string&& chunk, engine::Deadline deadline);
25 void SetHeader(
const std::string&,
const std::string&);
27 void SetHeader(std::string_view,
const std::string&);
29 void SetEndOfHeaders();
31 void SetStatusCode(
int status_code);
33 void SetStatusCode(HttpStatus status);
38 ResponseBodyStream(HttpResponse::Producer&& queue_producer, HttpResponse& http_response);
40 bool headers_ended_{
false};
41 HttpResponse::Producer queue_producer_;
42 HttpResponse& http_response_;