6#include <userver/engine/task/task.hpp>
7#include <userver/engine/task/task_processor_fwd.hpp>
8#include <userver/engine/task/task_with_result.hpp>
9#include <userver/utils/statistics/writer.hpp>
11USERVER_NAMESPACE_BEGIN
62 Producer(std::unique_ptr<impl::Configuration> configuration,
63 engine::TaskProcessor& producer_task_processor,
64 std::chrono::milliseconds poll_timeout, std::size_t send_retries);
70 Producer(
const Producer&) =
delete;
71 Producer(Producer&&) =
delete;
73 Producer& operator=(
const Producer&) =
delete;
74 Producer& operator=(Producer&&) =
delete;
97 void Send(
const std::string& topic_name, std::string_view key,
98 std::string_view message,
99 std::optional<std::uint32_t> partition =
std::
nullopt)
const;
110 std::string topic_name, std::string key, std::string message,
111 std::optional<std::uint32_t> partition =
std::
nullopt)
const;
115 void DumpMetric(utils::statistics::Writer& writer)
const;
118 void InitProducerAndStartPollingIfFirstSend()
const;
120 void VerifyNotFinished()
const;
123 void SendToTestPoint(std::string_view topic_name, std::string_view key,
124 std::string_view message)
const;
127 void ExtendCurrentSpan()
const;
130 const std::string component_name_;
131 engine::TaskProcessor& producer_task_processor_;
133 const std::chrono::milliseconds poll_timeout_{};
134 const std::size_t send_retries_{};
136 mutable std::atomic<
bool> first_send_{
true};
137 mutable std::unique_ptr<impl::Configuration> configuration_;
138 mutable std::unique_ptr<impl::ProducerImpl>
140 mutable engine::
Task poll_task_;