Adds timeout capabilities to blocking Rpc Calls (#86)

This commit is contained in:
Thad House
2016-08-15 20:24:07 -07:00
committed by Peter Johnson
parent bc99d341fb
commit 0b80bd2b09
10 changed files with 83 additions and 3 deletions

View File

@@ -128,6 +128,10 @@ bool PollRpc(bool blocking, RpcCallInfo* call_info) {
return RpcServer::GetInstance().PollRpc(blocking, call_info);
}
bool PollRpc(bool blocking, double time_out, RpcCallInfo* call_info) {
return RpcServer::GetInstance().PollRpc(blocking, time_out, call_info);
}
void PostRpcResponse(unsigned int rpc_id, unsigned int call_uid,
StringRef result) {
RpcServer::GetInstance().PostRpcResponse(rpc_id, call_uid, result);
@@ -141,6 +145,12 @@ bool GetRpcResult(bool blocking, unsigned int call_uid, std::string* result) {
return Storage::GetInstance().GetRpcResult(blocking, call_uid, result);
}
bool GetRpcResult(bool blocking, unsigned int call_uid,
double time_out, std::string* result) {
return Storage::GetInstance().GetRpcResult(blocking, call_uid, time_out,
result);
}
std::string PackRpcDefinition(const RpcDefinition& def) {
WireEncoder enc(0x0300);
enc.Write8(def.version);