6#include <userver/concurrent/async_event_channel.hpp>
7#include <userver/engine/single_consumer_event.hpp>
8#include <userver/engine/task/task_with_result.hpp>
10USERVER_NAMESPACE_BEGIN
26 explicit ConflatedEventChannel(std::string name, OnRemoveCallback on_listener_removal = {});
27 ~ConflatedEventChannel() override;
30 template <
typename... Args>
37 template <
typename Class>
43 template <
typename... Args>
44 void OnChannelEvent(Args...);
46 std::atomic<
bool> stop_flag_;
48 std::vector<concurrent::AsyncEventSubscriberScope> subscriptions_;
49 engine::SingleConsumerEvent event_;
52template <
typename... Args>
54 subscriptions_.push_back(channel.AddListener(
this, Name(), &ConflatedEventChannel::OnChannelEvent<Args...>));
57template <
typename Class>
60 return DoUpdateAndListen(obj, name, func, [&] { (obj->*func)(); });
63template <
typename... Args>