diff options
Diffstat (limited to 'src/main/java/com/orbekk/protobuf/Rpc.java')
-rw-r--r-- | src/main/java/com/orbekk/protobuf/Rpc.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/orbekk/protobuf/Rpc.java b/src/main/java/com/orbekk/protobuf/Rpc.java index 34cdb31..f22bbc3 100644 --- a/src/main/java/com/orbekk/protobuf/Rpc.java +++ b/src/main/java/com/orbekk/protobuf/Rpc.java @@ -28,6 +28,7 @@ public class Rpc implements RpcController { private volatile String errorText = ""; private volatile boolean hasFailed; private volatile boolean canceled; + private volatile long timeoutMillis = 0; private volatile List<RpcCallback<Object>> cancelNotificationListeners = null; public Rpc() { @@ -122,6 +123,18 @@ public class Rpc implements RpcController { } } } + + public long getTimout() { + return timeoutMillis; + } + + /** Set the timeout in number of milliseconds. + * + * The default timeout is 0, i.e. never time out. + */ + public void setTimout(long milliseconds) { + timeoutMillis = milliseconds; + } @Override public void startCancel() { |