Class Timeout.Builder
-
- All Implemented Interfaces:
public final class Timeout.Builder
A builder for Timeout.
-
-
Method Summary
Modifier and Type Method Description final Timeout.Builder
connect(Duration connect)
The maximum time allowed to establish a connection with a host. final Timeout.Builder
connect(Optional<Duration> connect)
The maximum time allowed to establish a connection with a host. final Timeout.Builder
read(Duration read)
The maximum time allowed between two data packets when waiting for the server’s response. final Timeout.Builder
read(Optional<Duration> read)
The maximum time allowed between two data packets when waiting for the server’s response. final Timeout.Builder
write(Duration write)
The maximum time allowed between two data packets when sending the request to the server. final Timeout.Builder
write(Optional<Duration> write)
The maximum time allowed between two data packets when sending the request to the server. final Timeout.Builder
request(Duration request)
The maximum time allowed for a complete HTTP call, not including retries. final Timeout.Builder
request(Optional<Duration> request)
The maximum time allowed for a complete HTTP call, not including retries. final Timeout
build()
-
-
Method Detail
-
connect
final Timeout.Builder connect(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)
.
-
connect
final Timeout.Builder connect(Optional<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 Timeout.Builder read(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()
.
-
read
final Timeout.Builder read(Optional<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 Timeout.Builder write(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()
.
-
write
final Timeout.Builder write(Optional<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 Timeout.Builder request(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)
.
-
request
final Timeout.Builder request(Optional<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)
.
-
-
-
-