You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #117 from jcalcote/feature/m/specify-connect-timeout-in-client-builder
Specify client connect timeout in OncRpcClientBuilder; consume in OncRpcClient connect call.
This change adds a withConnectTimeout method to the OncRpcClientBuilder, which populates two fields:
long connectTimeout;
TimeUnit connectTimeoutUnit;
These fields are then passed into the OncRpcClient during build and stored there as final fields on the OncRpcClient. When connect() is called, these values are used. They default to the same values that connect() originally used - Long.MAX_VALUE, and TimeUnit.MILLISECONDS.
This change allows generated interfaces to use a user-specified connect timeout, defaulting to the original default values if not specified. Note the rpcgen code did not need to be modified for this, as it continues to use rpcClient.connect(), but internally, this method uses the builder-specified default values, or the original default values if no builder was used.
An additional constructor is added to facilitate passing the default connect timeout parameters, which makes it possible for non-builder-users to also specify the default connect timeout (though they may also pass those values to connect directly).
0 commit comments