#pragma once
#include <functional>
#include <memory>

namespace myapp::modbus {

class poll
{
public:
    using task_t = std::function<void()>;
    using task_executor_t = std::function<void(task_t)>;

    static std::shared_ptr<poll> create();

    virtual ~poll() = default;
    virtual task_executor_t executor() = 0;
    virtual void run() = 0;
    virtual void abort() = 0;
};

} /* namespace myapp::modbus */
