30#if KCENON_WITH_THREAD_SYSTEM
32# pragma clang diagnostic push
33# pragma clang diagnostic ignored "-Wdeprecated-declarations"
36# include <kcenon/thread/core/thread_pool.h>
37# include <kcenon/thread/interfaces/thread_context.h>
38# include <kcenon/thread/interfaces/service_container.h>
39# pragma clang diagnostic pop
44#if KCENON_WITH_THREAD_SYSTEM
46class thread_system_pool_adapter :
public thread_pool_interface {
48 [[nodiscard]]
static Result<std::shared_ptr<thread_system_pool_adapter>> create(
49 std::shared_ptr<kcenon::thread::thread_pool> pool);
50 ~thread_system_pool_adapter();
53 thread_system_pool_adapter(
const thread_system_pool_adapter&) =
delete;
54 thread_system_pool_adapter& operator=(
const thread_system_pool_adapter&) =
delete;
55 thread_system_pool_adapter(thread_system_pool_adapter&&) =
delete;
56 thread_system_pool_adapter& operator=(thread_system_pool_adapter&&) =
delete;
59 std::future<void> submit(std::function<
void()> task)
override;
60 std::future<void> submit_delayed(std::function<
void()> task,
61 std::chrono::milliseconds delay)
override;
62 size_t worker_count()
const override;
63 bool is_running()
const override;
64 size_t pending_tasks()
const override;
67 static std::shared_ptr<thread_system_pool_adapter> create_default(
68 const std::string& pool_name =
"network_pool");
71 static std::shared_ptr<thread_system_pool_adapter> from_service_or_default(
72 const std::string& pool_name =
"network_pool");
75 explicit thread_system_pool_adapter(std::shared_ptr<kcenon::thread::thread_pool> pool);
83 std::shared_ptr<kcenon::thread::thread_pool> pool_;
86bool bind_thread_system_pool_into_manager(
const std::string& pool_name =
"network_pool");
Feature flags for network_system.
Network-specific error and result type definitions.
thread_system_pool_adapter_unavailable()=delete
Thread system integration interface for network_system.