ThreadSchedule 3.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
polling_pool.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "../detail/pool/backend.hpp"
4#include "../detail/pool/facade.hpp"
5
7{
8class polling_pool final
9 : private ::threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend>
10{
12
13public:
16 : base(count, registration)
17 {
18 }
19
26 using base::post;
28 using base::shutdown;
30 using base::size;
31 using base::submit;
35 using base::wait;
36};
37} // namespace threadschedule::advanced
polling_pool(worker_count count=worker_count::automatic(), worker_registration registration=worker_registration::disabled)
auto submit_batch_or_throw(Iterator begin, Iterator end) -> std::vector< std::future< void > >
auto submit_or_throw(F &&function, Args &&... args) -> std::future< bind_result_t< F, Args... > >
auto submit(F &&function, Args &&... args) -> result< std::future< bind_result_t< F, Args... > > >
auto submit_batch(Iterator begin, Iterator end) -> result< std::vector< std::future< void > > >
auto parallel_for_each(Iterator begin, Iterator end, Function &&function) -> result< void >
auto shutdown(shutdown_policy policy=shutdown_policy::drain) -> result< void >
Value type for pool worker count.
static constexpr auto automatic() noexcept -> worker_count
Create automatic worker count.
worker_registration
Controls whether pool workers are registered in a thread registry.
@ disabled
Do not register workers in the global registry.