Top Description Fields Constructors Methods
io.vertx.core.http

public Class PoolOptions

extends Object
Class Inheritance
Annotations
@DataObject
@JsonGen
publicConverter:false
Imports
io.vertx.codegen.annotations.DataObject, io.vertx.codegen.json.annotations.JsonGen, io.vertx.core.impl.Arguments, io.vertx.core.json.JsonObject

Options configuring a HttpClientPool.
Author
Julien Viet

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
PoolOptions()

Default constructor

public
PoolOptions(PoolOptions
the options to copy
other
)

Copy constructor

public
PoolOptions(JsonObject
the JSON
json
)
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Constructor to create an options from JSON

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the connection pool cleaner period in ms.
getCleanerPeriod
()

public int

Returns:

the max number of event-loop a pool will use, the default value is 0 which implies to reuse the current event-loop
getEventLoopSize
()

public int

Returns:

the maximum pool size
getHttp1MaxSize
()

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

public int

Returns:

the maximum pool size
getHttp2MaxSize
()

Get the maximum pool size for HTTP/2 connections

public int

Returns:

the maximum wait queue size
getMaxWaitQueueSize
()

Returns the maximum wait queue size

public PoolOptions

Returns:

a reference to this, so the API can be used fluently
setCleanerPeriod
(int
the pool cleaner period
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.

public PoolOptions

Returns:

a reference to this, so the API can be used fluently
setEventLoopSize
(int
the new size
eventLoopSize
)

Set the number of event-loop the pool use.

public PoolOptions

Returns:

a reference to this, so the API can be used fluently
setHttp1MaxSize
(int
the maximum pool size
http1MaxSize
)

Set the maximum pool size for HTTP/1.x connections

public PoolOptions

Returns:

a reference to this, so the API can be used fluently
setHttp2MaxSize
(int
the maximum pool size
max
)

Set the maximum pool size for HTTP/2 connections

public PoolOptions

Returns:

a reference to this, so the API can be used fluently
setMaxWaitQueueSize
(int
the maximum number of waiting requests
maxWaitQueueSize
)

Set the maximum requests allowed in the wait queue, any requests beyond the max size will result in a ConnectionPoolTooBusyException.

public JsonObject
toJson()
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cleanerPeriodback to summary
private int cleanerPeriod
eventLoopSizeback to summary
private int eventLoopSize
http1MaxSizeback to summary
private int http1MaxSize
http2MaxSizeback to summary
private int http2MaxSize
maxWaitQueueSizeback to summary
private int maxWaitQueueSize

Constructor Detail

PoolOptionsback to summary
public PoolOptions()

Default constructor

PoolOptionsback to summary
public PoolOptions(PoolOptions other)

Copy constructor

Parameters
other:PoolOptions

the options to copy

PoolOptionsback to summary
public PoolOptions(JsonObject json)

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructor to create an options from JSON

Parameters
json:JsonObject

the JSON

Method Detail

getCleanerPeriodback to summary
public int getCleanerPeriod()
Returns:int

the connection pool cleaner period in ms.

getEventLoopSizeback to summary
public int getEventLoopSize()
Returns:int

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

getHttp1MaxSizeback to summary
public int getHttp1MaxSize()

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

Returns:int

the maximum pool size

getHttp2MaxSizeback to summary
public int getHttp2MaxSize()

Get the maximum pool size for HTTP/2 connections

Returns:int

the maximum pool size

getMaxWaitQueueSizeback to summary
public int getMaxWaitQueueSize()

Returns the maximum wait queue size

Returns:int

the maximum wait queue size

setCleanerPeriodback to summary
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:int

the pool cleaner period

Returns:PoolOptions

a reference to this, so the API can be used fluently

setEventLoopSizeback to summary
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:int

the new size

Returns:PoolOptions

a reference to this, so the API can be used fluently

setHttp1MaxSizeback to summary
public PoolOptions setHttp1MaxSize(int http1MaxSize)

Set the maximum pool size for HTTP/1.x connections

Parameters
http1MaxSize:int

the maximum pool size

Returns:PoolOptions

a reference to this, so the API can be used fluently

setHttp2MaxSizeback to summary
public PoolOptions setHttp2MaxSize(int max)

Set the maximum pool size for HTTP/2 connections

Parameters
max:int

the maximum pool size

Returns:PoolOptions

a reference to this, so the API can be used fluently

setMaxWaitQueueSizeback to summary
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:int

the maximum number of waiting requests

Returns:PoolOptions

a reference to this, so the API can be used fluently

toJsonback to summary
public JsonObject toJson()

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.