mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-18 09:17:12 +00:00
wip
This commit is contained in:
@ -129,6 +129,33 @@ struct MsgYesstr : NonCopyable {
|
||||
MsgYesstr(Var &&msg_) : msg(std::move(msg_)) {}
|
||||
};
|
||||
|
||||
struct MsgXor : NonCopyable {
|
||||
struct NewView {
|
||||
Subscription sub;
|
||||
uint64_t idSize;
|
||||
std::string query;
|
||||
};
|
||||
|
||||
struct QueryView {
|
||||
uint64_t connId;
|
||||
SubId subId;
|
||||
uint64_t queryId;
|
||||
std::string query;
|
||||
};
|
||||
|
||||
struct RemoveView {
|
||||
uint64_t connId;
|
||||
SubId subId;
|
||||
};
|
||||
|
||||
struct CloseConn {
|
||||
uint64_t connId;
|
||||
};
|
||||
|
||||
using Var = std::variant<NewView, QueryView, RemoveView, CloseConn>;
|
||||
Var msg;
|
||||
MsgXor(Var &&msg_) : msg(std::move(msg_)) {}
|
||||
};
|
||||
|
||||
struct RelayServer {
|
||||
std::unique_ptr<uS::Async> hubTrigger;
|
||||
@ -141,6 +168,7 @@ struct RelayServer {
|
||||
ThreadPool<MsgReqWorker> tpReqWorker;
|
||||
ThreadPool<MsgReqMonitor> tpReqMonitor;
|
||||
ThreadPool<MsgYesstr> tpYesstr;
|
||||
ThreadPool<MsgXor> tpXor;
|
||||
std::thread cronThread;
|
||||
|
||||
void run();
|
||||
@ -151,6 +179,7 @@ struct RelayServer {
|
||||
void ingesterProcessEvent(lmdb::txn &txn, uint64_t connId, std::string ipAddr, secp256k1_context *secpCtx, const tao::json::value &origJson, std::vector<MsgWriter> &output);
|
||||
void ingesterProcessReq(lmdb::txn &txn, uint64_t connId, const tao::json::value &origJson);
|
||||
void ingesterProcessClose(lmdb::txn &txn, uint64_t connId, const tao::json::value &origJson);
|
||||
void ingesterProcessXor(lmdb::txn &txn, uint64_t connId, const tao::json::value &origJson);
|
||||
|
||||
void runWriter(ThreadPool<MsgWriter>::Thread &thr);
|
||||
|
||||
@ -160,6 +189,8 @@ struct RelayServer {
|
||||
|
||||
void runYesstr(ThreadPool<MsgYesstr>::Thread &thr);
|
||||
|
||||
void runXor(ThreadPool<MsgXor>::Thread &thr);
|
||||
|
||||
void runCron();
|
||||
|
||||
// Utils (can be called by any thread)
|
||||
|
Reference in New Issue
Block a user