Skip to content

Commit

Permalink
misc: trade compile time for better error messages on coro timers
Browse files Browse the repository at this point in the history
  • Loading branch information
Mishura4 committed Dec 16, 2024
1 parent c14422d commit 7d867d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/dpp/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class DPP_EXPORT cluster {
* @param frequency How often to tick the timer in seconds
* @return timer A handle to the timer, used to remove that timer later
*/
template <typename T, typename U = std::function<void(timer)>>
template <std::invocable<timer> T, std::invocable<timer> U = std::function<void(timer)>>
requires (dpp::awaitable_type<typename std::invoke_result<T, timer>::type>)
timer start_timer(T&& on_tick, uint64_t frequency, U&& on_stop = {}) {
std::function<void(timer)> ticker = [fun = std::forward<T>(on_tick)](timer t) mutable -> dpp::job {
Expand Down

0 comments on commit 7d867d8

Please sign in to comment.