8 #ifndef _TASKS_IO_TASK_H_
9 #define _TASKS_IO_TASK_H_
27 std::ostringstream os;
28 os <<
"disk_io_task(" <<
this <<
"," <<
m_fd <<
":" <<
m_events <<
")";
42 assert(
nullptr != task);
52 std::shared_future<std::streamsize>
op();
57 #endif // _TASKS_IO_TASK_H_
static std::shared_future< std::streamsize > add_task(disk_io_task *task)
The base class for any task.
std::string get_string() const
std::streamsize bytes() const
virtual void start_watcher(worker *)
Activate the underlying watcher to listen for I/O or timer events.
virtual bool handle_event(worker *worker, int events)
virtual void dispose(worker *worker=nullptr)
virtual void stop_watcher(worker *)
Deactivate the underlying watcher.
std::shared_future< std::streamsize > op()
disk_io_task(int fd, int events, tools::buffer *buf)
virtual void init_watcher()
Initialize the underlying watcher object.