Summary: Previously, the RPC stack used the network stack only to receive messages. The messages were then added to a separate queue that was processed by different thread pools. This design was inefficient because there was a lock when inserting and getting messages from the common queue. This diff removes the need for separate thread pools by utilising the new network stack design. This is possible because the new network stack allows full processing of the network request without blocking the whole queue. Reviewers: buda, florijan, teon.banek, dgleich, mislav.bradac Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1229
30 lines
989 B
C++
30 lines
989 B
C++
#pragma once
|
|
|
|
#include <chrono>
|
|
|
|
#include "communication/rpc/messages.hpp"
|
|
#include "storage/types.hpp"
|
|
#include "transactions/commit_log.hpp"
|
|
#include "transactions/snapshot.hpp"
|
|
#include "transactions/type.hpp"
|
|
|
|
namespace storage {
|
|
|
|
#define ID_VALUE_RPC(type) \
|
|
RPC_SINGLE_MEMBER_MESSAGE(type##IdReq, std::string); \
|
|
RPC_SINGLE_MEMBER_MESSAGE(type##IdRes, storage::type); \
|
|
using type##IdRpc = \
|
|
communication::rpc::RequestResponse<type##IdReq, type##IdRes>; \
|
|
RPC_SINGLE_MEMBER_MESSAGE(Id##type##Req, storage::type); \
|
|
RPC_SINGLE_MEMBER_MESSAGE(Id##type##Res, std::string); \
|
|
using Id##type##Rpc = \
|
|
communication::rpc::RequestResponse<Id##type##Req, Id##type##Res>;
|
|
|
|
ID_VALUE_RPC(Label)
|
|
ID_VALUE_RPC(EdgeType)
|
|
ID_VALUE_RPC(Property)
|
|
|
|
#undef ID_VALUE_RPC
|
|
|
|
} // namespace storage
|