Skip to content
Welcome to the new CppUtils documentation!
using CppUtils::Thread::ScheduledEventDispatcher::Clock = std::chrono::steady_clock;
using CppUtils::Thread::ScheduledEventDispatcher::TimePoint = Clock::time_point;
using CppUtils::Thread::ScheduledEventDispatcher::SubscriptionIdentifier = Execution::EventDispatcher::SubscriptionIdentifier;
explicit ScheduledEventDispatcher::ScheduledEventDispatcher( Scheduler::Clock::duration step = std::chrono::milliseconds(10), std::size_t numberThreads = std::thread::hardware_concurrency(), std::function<void(std::exception_ptr)> onError = nullptr, std::function<void()> finally = nullptr);

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

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

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

auto ScheduledEventDispatcher::clearSubscribers() -> void;

template <String::Hasher eventName = Type::Hash{}, class... Args, Chrono::Duration Delay = std::chrono::milliseconds>
auto ScheduledEventDispatcher::emit(Delay delay, Args&&... args) -> void;

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

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

auto ScheduledEventDispatcher::waitUntilFinished() -> void;

auto ScheduledEventDispatcher::flush() -> void;

[[nodiscard]] auto ScheduledEventDispatcher::getScheduledTasksCount() const -> std::size_t;

auto ScheduledEventDispatcher::cancelAll() -> void;