2020-05-21 14:09:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string_view>
|
2021-02-02 14:35:40 +00:00
|
|
|
#include <oxenmq/oxenmq.h>
|
|
|
|
#include <oxenmq/address.h>
|
2022-09-28 16:37:19 +00:00
|
|
|
#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:
|
2022-09-28 16:37:19 +00:00
|
|
|
void
|
|
|
|
HandleLogsSubRequest(oxenmq::Message& m);
|
|
|
|
|
2020-05-21 14:09:45 +00:00
|
|
|
LMQ_ptr m_LMQ;
|
|
|
|
AbstractRouter* const m_Router;
|
2022-09-28 16:37:19 +00:00
|
|
|
|
|
|
|
oxen::log::PubsubLogger log_subs;
|
2020-05-21 14:09:45 +00:00
|
|
|
};
|
|
|
|
} // namespace llarp::rpc
|