diff --git a/meson_options.txt b/meson_options.txt index b5130c5..f45184c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1 @@ option('base_url', type: 'string', value: 'https://api.originsro.org') -option('thread_pool', type: 'combo', description: '', choices: ['roar11', 'taskflow'], value: 'roar11') diff --git a/src/config.hpp.in b/src/config.hpp.in index 38783a0..707a64f 100644 --- a/src/config.hpp.in +++ b/src/config.hpp.in @@ -1,10 +1,5 @@ #pragma once -#define THREADPOOL_ROAR11 1 -#define THREADPOOL_TASKFLOW 2 - -#define THREADPOOL THREADPOOL_@THREAD_POOL_TYPE@ - namespace duck { constexpr const char g_base_url[] = "@BASE_URL@"; diff --git a/src/evloop.cpp b/src/evloop.cpp index 4a5de03..f5e6501 100644 --- a/src/evloop.cpp +++ b/src/evloop.cpp @@ -2,37 +2,11 @@ #include "html_fetch_task.hpp" #include "eventia/eventia.hpp" #include "eventia/timer.hpp" - -#include "orotool_config.hpp" -#if THREADPOOL == THREADPOOL_TASKFLOW -# include -#elif THREADPOOL == THREADPOOL_ROAR11 -# include "roar11/ThreadPool.hpp" -#endif - +#include "roar11/ThreadPool.hpp" #include -#if THREADPOOL == THREADPOOL_TASKFLOW -namespace tf { - class Taskflow; - class Subflow; -} //namespace tf -#elif THREADPOOL == THREADPOOL_ROAR11 -namespace roar11 { - class ThreadPool; -} //namespace roar11 -#endif - namespace duck { namespace { -#if THREADPOOL == THREADPOOL_ROAR11 - typedef roar11::ThreadPool threadpool_type; - typedef roar11::ThreadPool subpool_type; -#elif THREADPOOL == THREADPOOL_TASKFLOW - typedef tf::Taskflow threadpool_type; - typedef tf::Subflow subpool_type; -#endif - //class KeepaliveTimer : public ev::timer { //public: // KeepaliveTimer (ev::loop_ref& loop, RunningPool::subpool_type*) { @@ -45,17 +19,10 @@ namespace { // } //}; -#if THREADPOOL == THREADPOOL_TASKFLOW -void join(tf::Executor& executor) { - executor.wait_for_all(); - std::cout << "all tasks completed\n"; -} -#else -void join(threadpool_type& pool) { +void join(roar11::ThreadPool& pool) { pool.join(); std::cout << "all tasks completed\n"; } -#endif } //unnamed namespace diff --git a/src/meson.build b/src/meson.build index 6c6e33d..a31eba4 100644 --- a/src/meson.build +++ b/src/meson.build @@ -11,9 +11,6 @@ sqlitecpp_dep = dependency('sqlitecpp', version: '>=3.0.0', ev_dep = dependency('libev', version: '>=4.31') threads_dep = dependency('threads') -if get_option('thread_pool') == 'taskflow' - taskflow_dep = dependency('Cpp-Taskflow', version: '>=2.4.0', method: 'cmake') -endif base_url = get_option('base_url').strip() if not base_url.endswith('/') @@ -22,11 +19,6 @@ endif conf = configuration_data() conf.set('BASE_URL', base_url) -if get_option('thread_pool') == 'roar11' - conf.set('THREAD_POOL_TYPE', 'ROAR11') -elif get_option('thread_pool') == 'taskflow' - conf.set('THREAD_POOL_TYPE', 'TASKFLOW') -endif project_config_file = configure_file( input: 'config.hpp.in', output: meson.project_name() + '_config.hpp', @@ -39,9 +31,6 @@ lib_deps = [ ev_dep, threads_dep, ] -if get_option('thread_pool') == 'taskflow' - lib_deps += [taskflow_dep] -endif executable(meson.project_name(), 'main.cpp',