More refactoring

This commit is contained in:
King_DuckZ 2020-08-09 20:47:04 +01:00
parent 73ec4446ea
commit c0461f6b09
6 changed files with 61 additions and 47 deletions

View file

@ -1,5 +1,5 @@
#include "evloop.hpp"
#include "html_fetch_task.hpp"
#include "timer_items.hpp"
#include "eventia/eventia.hpp"
#include "eventia/timer.hpp"
#include "roar11/ThreadPool.hpp"
@ -27,12 +27,13 @@ void join(roar11::ThreadPool& pool) {
} //unnamed namespace
void test() {
roar11::ThreadPool pool(std::max(2U, std::thread::hardware_concurrency()) - 1);
const std::size_t thread_count = 2U; //std::min(std::max(3U, std::thread::hardware_concurrency()) - 1, 4U);
std::cout << "Running with " << thread_count << " worker threads\n";
roar11::ThreadPool pool(thread_count);
eve::Eventia worker;
pool.submit(worker.event_functor());
std::cout << "Instantiating html timer\n";
auto fetcher = worker.make_timer<HtmlFetchTimer>(&pool, "test_url_lol");
auto fetcher = worker.make_timer<TimerItems>(3.0, &pool);
join(pool);
}