server monitor

This commit is contained in:
Michael Davidsaver
2020-01-22 12:25:21 -08:00
parent a1b9a64a06
commit c2a4224a21
12 changed files with 761 additions and 13 deletions
+15
View File
@@ -74,6 +74,21 @@ void ServerChannelControl::onRPC(std::function<void(std::unique_ptr<server::Exec
});
}
void ServerChannelControl::onSubscribe(std::function<void(std::unique_ptr<server::MonitorSetupOp>&&)>&& fn)
{
auto serv = server.lock();
if(!serv)
return;
serv->acceptor_loop.call([this, &fn](){
auto ch = chan.lock();
if(!ch)
return;
ch->onSubscribe = std::move(fn);
});
}
void ServerChannelControl::onClose(std::function<void(const std::string&)>&& fn)
{
auto serv = server.lock();