29#if KCENON_WITH_THREAD_SYSTEM
31# pragma clang diagnostic push
32# pragma clang diagnostic ignored "-Wdeprecated-declarations"
35# include <kcenon/thread/core/thread_pool.h>
36# include <kcenon/thread/interfaces/thread_context.h>
37# include <kcenon/thread/interfaces/service_container.h>
38# pragma clang diagnostic pop
43#if KCENON_WITH_THREAD_SYSTEM
45class thread_system_pool_adapter :
public thread_pool_interface {
47 explicit thread_system_pool_adapter(std::shared_ptr<kcenon::thread::thread_pool> pool);
48 ~thread_system_pool_adapter();
51 thread_system_pool_adapter(
const thread_system_pool_adapter&) =
delete;
52 thread_system_pool_adapter& operator=(
const thread_system_pool_adapter&) =
delete;
53 thread_system_pool_adapter(thread_system_pool_adapter&&) =
delete;
54 thread_system_pool_adapter& operator=(thread_system_pool_adapter&&) =
delete;
57 std::future<void> submit(std::function<
void()> task)
override;
58 std::future<void> submit_delayed(std::function<
void()> task,
59 std::chrono::milliseconds delay)
override;
60 size_t worker_count()
const override;
61 bool is_running()
const override;
62 size_t pending_tasks()
const override;
65 static std::shared_ptr<thread_system_pool_adapter> create_default(
66 const std::string& pool_name =
"network_pool");
69 static std::shared_ptr<thread_system_pool_adapter> from_service_or_default(
70 const std::string& pool_name =
"network_pool");
80 std::shared_ptr<kcenon::thread::thread_pool> pool_;
83bool bind_thread_system_pool_into_manager(
const std::string& pool_name =
"network_pool");
Feature flags for network_system.
thread_system_pool_adapter_unavailable()=delete
Thread system integration interface for network_system.