LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Public Attributes
LogCabin::Client::LeaderRPC::Call Class Reference

See LeaderRPCBase::Call. More...

Inheritance diagram for LogCabin::Client::LeaderRPC::Call:
LogCabin::Client::LeaderRPCBase::Call

List of all members.

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

LeaderRPCleaderRPC
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.

Detailed Description

See LeaderRPCBase::Call.

Definition at line 259 of file LeaderRPC.h.


Constructor & Destructor Documentation

Definition at line 71 of file LeaderRPC.cc.

Destructor.

Reimplemented from LogCabin::Client::LeaderRPCBase::Call.

Definition at line 78 of file LeaderRPC.cc.


Member Function Documentation

void LogCabin::Client::LeaderRPC::Call::start ( OpCode  opCode,
const google::protobuf::Message &  request,
TimePoint  timeout 
) [virtual]

Invoke the RPC.

Parameters:
opCodeRPC operation code. The caller must guarantee that this is a valid opCode. (If the server rejects it, this will PANIC.)
requestThe parameters for the operation. The caller must guarantee that this is a well-formed request. (If the server rejects it, this will PANIC.)
timeoutAfter 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.

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.

Parameters:
[out]responseIf successful, the response to the operation will be filled in here.
timeoutAfter this time has elapsed, stop waiting and return TIMEOUT. In this case, response will be left unmodified.
Returns:
True if the RPC completed successfully, false otherwise. If this returns false, it is the callers responsibility to start over to achieve the same at-most-once semantics as call().

Implements LogCabin::Client::LeaderRPCBase::Call.

Definition at line 104 of file LeaderRPC.cc.


Member Data Documentation

Definition at line 269 of file LeaderRPC.h.

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines