#pragma once
#include "eventloop.h"
#include <csignal>
#include <functional>
#include <memory>

namespace myapp::async {

class signal
{
public:
    virtual ~signal() = default;
    static std::unique_ptr<signal> create(std::shared_ptr<event_loop>);
    virtual void on(int signum, std::function<void(int signum)>) = 0;
    virtual void once(int signum, std::function<void(int signum)>) = 0;
    virtual void stop() = 0;
};

} /* namespace myapp::async */
