#include "../lib/asynco.hpp" namespace marcelb::asynco { void Asynco::init_loops_in_threads(uint8_t threads) { for (int i=0; i(io_ctx); init_loops_in_threads(threads); } void Asynco::run_on_this() { if (!_work) { _work = make_unique(io_ctx); } io_ctx.run(); } void Asynco::join() { for (auto& runner : _runners) { runner.join(); } } Timer Asynco::delayed(function callback, uint64_t time) { return Timer(io_ctx, callback, time, TimerType::Delayed); } Timer Asynco::periodic(function callback, uint64_t time) { return Timer(io_ctx, callback, time, TimerType::Periodic); } };