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.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • 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).