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

See LeaderRPCBase::Call. More...

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

List of all members.

Public Member Functions

 Call (LeaderRPCMock &leaderRPC)
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

LeaderRPCMockleaderRPC
bool canceled

Detailed Description

See LeaderRPCBase::Call.

Definition at line 68 of file LeaderRPCMock.h.


Constructor & Destructor Documentation

Definition at line 67 of file LeaderRPCMock.cc.


Member Function Documentation

void LogCabin::Client::LeaderRPCMock::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 74 of file LeaderRPCMock.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 92 of file LeaderRPCMock.cc.

LeaderRPCMock::Call::Status LogCabin::Client::LeaderRPCMock::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 98 of file LeaderRPCMock.cc.


Member Data Documentation

Definition at line 77 of file LeaderRPCMock.h.

Definition at line 78 of file LeaderRPCMock.h.


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