@InterfaceAudience.Private public class BlockingRpcCallback<R> extends Object implements com.google.protobuf.RpcCallback<R>
RpcCallback implementation providing a
Future-like get() method, which
will block util the instance's run(Object) method has been called.
R is the RPC response type that will be passed to the run(Object) method.| Constructor and Description |
|---|
BlockingRpcCallback() |
| Modifier and Type | Method and Description |
|---|---|
R |
get()
Returns the parameter passed to
run(Object) or null if a null value was
passed. |
void |
run(R parameter)
Called on completion of the RPC call with the response object, or
null in the case of
an error. |
public void run(R parameter)
null in the case of
an error.run in interface com.google.protobuf.RpcCallback<R>parameter - the response object or null if an error occurredpublic R get() throws IOException
run(Object) or null if a null value was
passed. When used asynchronously, this method will block until the run(Object)
method has been called.null if no response was passedIOExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.