3 ms·
That's one of the benefits of having it exposed as a type-enforced parameter. setConnectTimeout() could take a Duration, which contains the amount and the unit
by LgWoodenBadger 5y ago
That's one of the benefits of having it exposed as a type-enforced parameter. setConnectTimeout() could take a Duration, which contains the amount and the unit, and therefore wouldn't care if consumer A provided a timeout in seconds, and consumer B provided a timeout in milliseconds.
- gregmac 5y agoTotally agree, but then I would expect the code would be: request.setConnectTimeout(getDefaultTimeoutFromEnvironment()) with getDefaultTimeoutFromEnvironment() returning a Duration. Ideally this is consistent throughout the codebase, so that anything that uses a primitive type for time is explicitly labelled, and anything using a Duration can just be called "Timeout" or whatever.