8 #ifndef _TASKS_EVENT_TASK_H_
9 #define _TASKS_EVENT_TASK_H_
102 #endif // _TASKS_EVENT_TASK_H_
The base class for any task.
std::function< void(struct ev_loop *)> task_func_t
void notify_error(worker *worker=nullptr)
worker * assigned_worker() const
Returns a pointer to the assigned worker.
void operator()(worker *worker, const tasks_exception &e)
virtual void init_watcher()=0
Initialize the underlying watcher object.
std::function< void(const tasks_exception &e)> error_func_void_t
virtual bool handle_event(worker *worker, int events)=0
A helper class for basic error reporting.
void on_error(error_func_worker_t f)
error_func_void_t m_f_void
error_func_t(error_func_worker_t f)
error_func_t(error_func_void_t f)
void assign_worker(worker *worker)
virtual void start_watcher(worker *worker)=0
Activate the underlying watcher to listen for I/O or timer events.
std::vector< error_func_t > m_error_funcs
std::function< void(worker *worker, const tasks_exception &e)> error_func_worker_t
error_func_worker_t m_f_worker
void on_error(error_func_void_t f)
Install an error callback.
virtual void stop_watcher(worker *worker)=0
Deactivate the underlying watcher.