ThreadSchedule 1.0.0
Modern C++ thread management library
|
Global error handler for thread pool tasks. More...
#include <error_handler.hpp>
Public Member Functions | |
auto | add_callback (ErrorCallback callback) -> size_t |
Add an error callback. | |
void | clear_callbacks () |
Remove all error callbacks. | |
void | handle_error (TaskError const &error) |
Handle an exception from a task. | |
auto | error_count () const -> size_t |
Get total number of errors handled. | |
void | reset_error_count () |
Reset error count. |
Global error handler for thread pool tasks.
Allows registering callbacks that will be invoked when tasks throw exceptions. Multiple handlers can be registered and they will be called in order.
Definition at line 72 of file error_handler.hpp.
|
inline |
Add an error callback.
callback | Function to call when a task throws |
Definition at line 80 of file error_handler.hpp.
|
inline |
Remove all error callbacks.
Definition at line 90 of file error_handler.hpp.
|
inlinenodiscard |
Get total number of errors handled.
Definition at line 121 of file error_handler.hpp.
|
inline |
Handle an exception from a task.
error | Error information |
Definition at line 100 of file error_handler.hpp.
|
inline |
Reset error count.
Definition at line 130 of file error_handler.hpp.