Class Timeout
-
- All Implemented Interfaces:
public final class Timeout
A class containing timeouts for various processing phases of a request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Timeout.Builder
A builder for Timeout.
-
Method Summary
Modifier and Type Method Description final Duration
connect()
The maximum time allowed to establish a connection with a host. final Duration
read()
The maximum time allowed between two data packets when waiting for the server’s response. final Duration
write()
The maximum time allowed between two data packets when sending the request to the server. final Duration
request()
The maximum time allowed for a complete HTTP call, not including retries. final Timeout.Builder
toBuilder()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Timeout
default()
final static Timeout.Builder
builder()
Returns a mutable builder for constructing an instance of Timeout. -
-
Method Detail
-
connect
final Duration connect()
The maximum time allowed to establish a connection with a host.
A value of Duration.ZERO means there's no timeout.
Defaults to
Duration.ofMinutes(1)
.
-
read
final Duration read()
The maximum time allowed between two data packets when waiting for the server’s response.
A value of Duration.ZERO means there's no timeout.
Defaults to
request()
.
-
write
final Duration write()
The maximum time allowed between two data packets when sending the request to the server.
A value of Duration.ZERO means there's no timeout.
Defaults to
request()
.
-
request
final Duration request()
The maximum time allowed for a complete HTTP call, not including retries.
This includes resolving DNS, connecting, writing the request body, server processing, as well as reading the response body.
A value of Duration.ZERO means there's no timeout.
Defaults to
Duration.ofMinutes(10)
.
-
toBuilder
final Timeout.Builder toBuilder()
-
builder
final static Timeout.Builder builder()
Returns a mutable builder for constructing an instance of Timeout.
-
-
-
-