io.vertx.core.http

## Class PoolOptions

- java.lang.Object
- - io.vertx.core.http.PoolOptions

-     public class PoolOptions
      extends Object

  Options configuring a `HttpClientPool`.
  Author:
    Julien Viet

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PoolOptions()` Default constructor
    `PoolOptions(JsonObject json)` Constructor to create an options from JSON
    `PoolOptions(PoolOptions other)` Copy constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getCleanerPeriod()`
    `int` | `getEventLoopSize()`
    `int` | `getHttp1MaxSize()` Get the maximum pool size for HTTP/1.x connections
    `int` | `getHttp2MaxSize()` Get the maximum pool size for HTTP/2 connections
    `int` | `getMaxWaitQueueSize()` Returns the maximum wait queue size
    `PoolOptions` | `setCleanerPeriod(int cleanerPeriod)` Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections will remain in the pool until they are closed.
    `PoolOptions` | `setEventLoopSize(int eventLoopSize)` Set the number of event-loop the pool use.
    `PoolOptions` | `setHttp1MaxSize(int http1MaxSize)` Set the maximum pool size for HTTP/1.x connections
    `PoolOptions` | `setHttp2MaxSize(int max)` Set the maximum pool size for HTTP/2 connections
    `PoolOptions` | `setMaxWaitQueueSize(int maxWaitQueueSize)` Set the maximum requests allowed in the wait queue, any requests beyond the max size will result in a ConnectionPoolTooBusyException.
    `JsonObject` | `toJson()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PoolOptions

          public PoolOptions()

      Default constructor

    - #### PoolOptions

          public PoolOptions(PoolOptions other)

      Copy constructor
      Parameters:
        `other` - the options to copy

    - #### PoolOptions

          public PoolOptions(JsonObject json)

      Constructor to create an options from JSON
      Parameters:
        `json` - the JSON

  - ### Method Detail

    - #### getHttp1MaxSize

          public int getHttp1MaxSize()

      Get the maximum pool size for HTTP/1.x connections
      Returns:
        the maximum pool size

    - #### setHttp1MaxSize

          public PoolOptions setHttp1MaxSize(int http1MaxSize)

      Set the maximum pool size for HTTP/1.x connections
      Parameters:
        `http1MaxSize` - the maximum pool size
      Returns:
        a reference to this, so the API can be used fluently

    - #### getHttp2MaxSize

          public int getHttp2MaxSize()

      Get the maximum pool size for HTTP/2 connections
      Returns:
        the maximum pool size

    - #### setHttp2MaxSize

          public PoolOptions setHttp2MaxSize(int max)

      Set the maximum pool size for HTTP/2 connections
      Parameters:
        `max` - the maximum pool size
      Returns:
        a reference to this, so the API can be used fluently

    - #### getCleanerPeriod

          public int getCleanerPeriod()

      Returns:
        the connection pool cleaner period in ms.

    - #### setCleanerPeriod

          public PoolOptions setCleanerPeriod(int cleanerPeriod)

      Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections will remain in the pool until they are closed.
      Parameters:
        `cleanerPeriod` - the pool cleaner period
      Returns:
        a reference to this, so the API can be used fluently

    - #### getEventLoopSize

          public int getEventLoopSize()

      Returns:
        the max number of event-loop a pool will use, the default value is `0` which implies to reuse the current event-loop

    - #### setEventLoopSize

          public PoolOptions setEventLoopSize(int eventLoopSize)

      Set the number of event-loop the pool use.
      - when the size is `0`, the client pool will use the current event-loop
      - otherwise the client will create and use its own event loop
      The default size is `0`.
      Parameters:
        `eventLoopSize` - the new size
      Returns:
        a reference to this, so the API can be used fluently

    - #### setMaxWaitQueueSize

          public PoolOptions setMaxWaitQueueSize(int maxWaitQueueSize)

      Set the maximum requests allowed in the wait queue, any requests beyond the max size will result in a ConnectionPoolTooBusyException. If the value is set to a negative number then the queue will be unbounded.
      Parameters:
        `maxWaitQueueSize` - the maximum number of waiting requests
      Returns:
        a reference to this, so the API can be used fluently

    - #### getMaxWaitQueueSize

          public int getMaxWaitQueueSize()

      Returns the maximum wait queue size
      Returns:
        the maximum wait queue size

    - #### toJson

          public JsonObject toJson()

Copyright © 2024 Eclipse. All rights reserved.