LogCabin
|
See LeaderRPCBase::Call. More...
Public Member Functions | |
Call (LeaderRPC &leaderRPC) | |
~Call () | |
Destructor. | |
void | start (OpCode opCode, const google::protobuf::Message &request, TimePoint timeout) |
Invoke the RPC. | |
void | cancel () |
Cancel the RPC. | |
Status | wait (google::protobuf::Message &response, TimePoint timeout) |
Wait for the RPC to complete. | |
Public Attributes | |
LeaderRPC & | leaderRPC |
std::shared_ptr < RPC::ClientSession > | cachedSession |
Copy of leaderSession when the RPC was started (might have changed since). | |
RPC::ClientRPC | rpc |
RPC object which may be canceled. |
See LeaderRPCBase::Call.
Definition at line 259 of file LeaderRPC.h.
LogCabin::Client::LeaderRPC::Call::Call | ( | LeaderRPC & | leaderRPC | ) | [explicit] |
Definition at line 71 of file LeaderRPC.cc.
LogCabin::Client::LeaderRPC::Call::~Call | ( | ) | [virtual] |
Destructor.
Reimplemented from LogCabin::Client::LeaderRPCBase::Call.
Definition at line 78 of file LeaderRPC.cc.
void LogCabin::Client::LeaderRPC::Call::start | ( | OpCode | opCode, |
const google::protobuf::Message & | request, | ||
TimePoint | timeout | ||
) | [virtual] |
Invoke the RPC.
opCode | RPC operation code. The caller must guarantee that this is a valid opCode. (If the server rejects it, this will PANIC.) |
request | The parameters for the operation. The caller must guarantee that this is a well-formed request. (If the server rejects it, this will PANIC.) |
timeout | After this time has elapsed, stop trying to initiate the connection to the leader and use an invalid session, which will cause the RPC to fail later. |
Implements LogCabin::Client::LeaderRPCBase::Call.
Definition at line 83 of file LeaderRPC.cc.
void LogCabin::Client::LeaderRPC::Call::cancel | ( | ) | [virtual] |
Cancel the RPC.
This may only be called after start(), but it may be called safely from a separate thread.
Implements LogCabin::Client::LeaderRPCBase::Call.
Definition at line 97 of file LeaderRPC.cc.
LeaderRPC::Call::Status LogCabin::Client::LeaderRPC::Call::wait | ( | google::protobuf::Message & | response, |
TimePoint | timeout | ||
) | [virtual] |
Wait for the RPC to complete.
[out] | response | If successful, the response to the operation will be filled in here. |
timeout | After this time has elapsed, stop waiting and return TIMEOUT. In this case, response will be left unmodified. |
Implements LogCabin::Client::LeaderRPCBase::Call.
Definition at line 104 of file LeaderRPC.cc.
Definition at line 269 of file LeaderRPC.h.
std::shared_ptr<RPC::ClientSession> LogCabin::Client::LeaderRPC::Call::cachedSession |
Copy of leaderSession when the RPC was started (might have changed since).
Definition at line 274 of file LeaderRPC.h.
RPC object which may be canceled.
Definition at line 278 of file LeaderRPC.h.