Timer queries the remote api
This commit is contained in:
parent
c0461f6b09
commit
8fa434e76e
5 changed files with 40 additions and 16 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "eventia/eventia.hpp"
|
||||
#include "eventia/timer.hpp"
|
||||
#include "roar11/ThreadPool.hpp"
|
||||
#include "oro/api.hpp"
|
||||
#include <iostream>
|
||||
|
||||
namespace duck {
|
||||
|
@ -26,14 +27,14 @@ void join(roar11::ThreadPool& pool) {
|
|||
|
||||
} //unnamed namespace
|
||||
|
||||
void test() {
|
||||
void test(oro::Api* api) {
|
||||
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());
|
||||
|
||||
auto fetcher = worker.make_timer<TimerItems>(3.0, &pool);
|
||||
auto fetcher = worker.make_timer<TimerItems>(3.0, &pool, api);
|
||||
|
||||
join(pool);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue