|
| | PoolWithErrors (size_t num_threads=std::thread::hardware_concurrency()) |
| template<typename F, typename... Args> |
| auto | submit (F &&f, Args &&... args) -> FutureWithErrorHandler< std::invoke_result_t< F, Args... > > |
| | Submit a task with automatic error handling.
|
| template<typename F, typename... Args> |
| auto | submit_with_description (std::string const &description, F &&f, Args &&... args) -> FutureWithErrorHandler< std::invoke_result_t< F, Args... > > |
| | Submit a task with a description for better error messages.
|
| template<typename F, typename... Args> |
| auto | try_submit (F &&f, Args &&... args) -> expected< FutureWithErrorHandler< std::invoke_result_t< F, Args... > >, std::error_code > |
| | Submit a task, returning an error instead of throwing on shutdown.
|
| auto | add_error_callback (ErrorCallback callback) -> size_t |
| auto | remove_error_callback (size_t id) -> bool |
| void | clear_error_callbacks () |
| auto | error_count () const -> size_t |
| void | reset_error_count () |
| auto | pool () -> PoolType & |
| auto | get_statistics () const -> decltype(auto) |
| auto | configure_threads (std::string const &name_prefix, SchedulingPolicy policy=SchedulingPolicy::OTHER, ThreadPriority priority=ThreadPriority::normal()) -> decltype(auto) |
| auto | set_affinity (ThreadAffinity const &affinity) -> decltype(auto) |
| auto | distribute_across_cpus () -> decltype(auto) |
| void | wait_for_tasks () |
| void | shutdown () |
| auto | size () const noexcept -> size_t |
| auto | pending_tasks () const -> size_t |
template<typename PoolType>
class threadschedule::PoolWithErrors< PoolType >
Thread pool wrapper that combines any pool type with an ErrorHandler.
Non-copyable, non-movable. Thread-safe (delegates to the underlying pool).
submit() wraps every task so that exceptions are both reported to the ErrorHandler (via registered callbacks) and re-thrown, making them accessible through the returned FutureWithErrorHandler. submit_with_description() additionally attaches a user-supplied description string to the error report for easier diagnostics.
- See also
- FutureWithErrorHandler, ErrorHandler, TaskError
- Template Parameters
-
Definition at line 32 of file thread_pool_with_errors.hpp.