lokinet/llarp/rpc/rpc_server.hpp

34 lines
595 B
C++
Raw Normal View History

2020-05-21 14:09:45 +00:00
#pragma once
#include <string_view>
#include <oxenmq/oxenmq.h>
#include <oxenmq/address.h>
#include <oxen/log/omq_logger.hpp>
2020-05-21 14:09:45 +00:00
namespace llarp
{
struct AbstractRouter;
}
namespace llarp::rpc
{
2021-02-03 18:12:21 +00:00
using LMQ_ptr = std::shared_ptr<oxenmq::OxenMQ>;
2020-05-21 14:09:45 +00:00
struct RpcServer
{
explicit RpcServer(LMQ_ptr, AbstractRouter*);
~RpcServer() = default;
void
2021-02-03 18:12:21 +00:00
AsyncServeRPC(oxenmq::address addr);
2020-05-21 14:09:45 +00:00
private:
void
HandleLogsSubRequest(oxenmq::Message& m);
2020-05-21 14:09:45 +00:00
LMQ_ptr m_LMQ;
AbstractRouter* const m_Router;
oxen::log::PubsubLogger log_subs;
2020-05-21 14:09:45 +00:00
};
} // namespace llarp::rpc