Put some initial TODO's into the thrift handle
This commit is contained in:
@@ -11,11 +11,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "io/message_conversion.hpp"
|
||||||
#include "io/transport.hpp"
|
#include "io/transport.hpp"
|
||||||
|
|
||||||
namespace memgraph::io::thrift {
|
namespace memgraph::io::thrift {
|
||||||
|
|
||||||
using memgraph::io::Address;
|
using memgraph::io::Address;
|
||||||
|
using memgraph::io::OpaqueMessage;
|
||||||
|
using memgraph::io::OpaquePromise;
|
||||||
|
|
||||||
class ThriftHandle {
|
class ThriftHandle {
|
||||||
// the responses to requests that are being waited on
|
// the responses to requests that are being waited on
|
||||||
@@ -24,16 +27,27 @@ class ThriftHandle {
|
|||||||
// messages that are sent to servers that may later receive them
|
// messages that are sent to servers that may later receive them
|
||||||
std::map<Address, std::vector<OpaqueMessage>> can_receive_;
|
std::map<Address, std::vector<OpaqueMessage>> can_receive_;
|
||||||
|
|
||||||
|
// TODO(tyler) thrift clients for each outbound address combination
|
||||||
|
std::map<Address, void> clients_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template <Message Request, Message Response>
|
template <Message Request, Message Response>
|
||||||
void SubmitRequest(Address to_address, Address from_address, uint64_t request_id, Request &&request, Duration timeout,
|
void SubmitRequest(Address to_address, Address from_address, uint64_t request_id, Request &&request, Duration timeout,
|
||||||
ResponsePromise<Response> &&promise);
|
ResponsePromise<Response> &&promise) {
|
||||||
|
// TODO(tyler) simular to simulator transport, add the promise to the promises_ map
|
||||||
|
|
||||||
|
Send(to_address, from_address, request_id, request);
|
||||||
|
}
|
||||||
|
|
||||||
template <Message... Ms>
|
template <Message... Ms>
|
||||||
requires(sizeof...(Ms) > 0) RequestResult<Ms...> Receive(const Address &receiver, Duration timeout);
|
requires(sizeof...(Ms) > 0) RequestResult<Ms...> Receive(const Address &receiver, Duration timeout) {
|
||||||
|
// TODO(tyler) block for the specified duration on the Inbox's receipt of a message of this type.
|
||||||
|
}
|
||||||
|
|
||||||
template <Message M>
|
template <Message M>
|
||||||
void Send(Address to_address, Address from_address, uint64_t request_id, M message);
|
void Send(Address to_address, Address from_address, uint64_t request_id, M message) {
|
||||||
|
// TODO(tyler) call thrift client for address (or create one if it doesn't exist yet)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace memgraph::io::thrift
|
} // namespace memgraph::io::thrift
|
||||||
|
|||||||
Reference in New Issue
Block a user