Skip to content
Welcome to the new CppUtils documentation!
using CppUtils::Thread::AsyncEventDispatcher::SubscriptionIdentifier = Execution::EventDispatcher::SubscriptionIdentifier;
explicit AsyncEventDispatcher::AsyncEventDispatcher( std::size_t numberThreads = std::ranges::max(1uz, static_cast<std::size_t>(std::thread::hardware_concurrency())), std::function<void(std::exception_ptr)> onError = nullptr, std::function<void()> finally = nullptr);

template <String::Hasher eventName = Type::Hash{}, class... Args>
auto AsyncEventDispatcher::emit(const Args&... args) -> void;

template <class... Args>
auto AsyncEventDispatcher::emit(Type::Hash eventName, Args&&... args) -> void;

template <String::Hasher... eventNames>
auto AsyncEventDispatcher::subscribe(auto&& function);

template <String::Hasher... eventNames>
auto AsyncEventDispatcher::unsubscribe() -> bool;

auto AsyncEventDispatcher::unsubscribe(auto&& subscriptionIdentifierOrEventHash);

auto AsyncEventDispatcher::clearSubscribers() -> void;

auto AsyncEventDispatcher::waitUntilFinished() -> void;