Signed-off-by: Sangwan Kwon <sangwan.kwon@samsung.com>
Server(Server&&) = default;
Server& operator=(Server&&) = default;
- void run() override
+ /// boost-based service does not support timeout and stopper.
+ void run(int timeout = -1, interface::Stopper stopper = nullptr) override
{
+ (void) timeout;
+ (void) stopper;
this->context.run();
}
Server(Server&&) = default;
Server& operator=(Server&&) = default;
- void run(void) override
+ void run(int timeout = -1, interface::Stopper stopper = nullptr) override
{
- this->mainloop.run();
+ this->mainloop.run(timeout, stopper);
}
void stop(void) override
namespace interface {
using Task = std::function<Message(Message&)>;
+using Stopper = std::function<bool(void)>;
class Server {
public:
Server(Server&&) = default;
Server& operator=(Server&&) = default;
- virtual void run() = 0;
+ virtual void run(int timeout = -1, Stopper stopper = nullptr) = 0;
virtual void stop() = 0;
private: