PoolConfig that can be extended to bear more configuration options
with access to a copy constructor for the basic options.
| Modifier and Type | Field and Description |
|---|---|
| protected final Scheduler | |
| protected final AllocationStrategy | |
| protected final Mono | |
| protected final Clock | |
| protected final Function | |
| protected final Duration | |
| protected final Scheduler | |
| protected final BiPredicate | |
| protected final boolean | |
| protected final int | |
| protected final PoolMetricsRecorder | |
| protected final BiFunction | |
| protected final Function |
| Access | Constructor and Description |
|---|---|
| public | DefaultPoolConfig(Mono<POOLABLE> allocator, AllocationStrategy allocationStrategy, int maxPending, BiFunction<Runnable, Duration, Disposable> pendingAcquireTimer, Function<POOLABLE, ? extends Publisher<Void>> releaseHandler, Function<POOLABLE, ? extends Publisher<Void>> destroyHandler, BiPredicate<POOLABLE, PooledRefMetadata> evictionPredicate, Duration evictInBackgroundInterval, Scheduler evictInBackgroundScheduler, Scheduler acquisitionScheduler, PoolMetricsRecorder metricsRecorder, Clock clock, boolean isIdleLRU)
|
| protected | DefaultPoolConfig(PoolConfig<POOLABLE>
the original toCopy)PoolConfig to copy (only standard PoolConfig
options are copied)Copy constructor for the benefit of specializations of |
| Modifier and Type | Method and Description |
|---|---|
| public Scheduler | acquisitionScheduler()
Implements reactor. Pool implementation MAY decide to use the Scheduler
to publish resources in a more deterministic way: the publishing thread would then
always be the same, independently of which thread called Pool#acquire() or
PooledRef#release() or on which thread the allocator produced new
resources.
|
| public AllocationStrategy | allocationStrategy()
Implements reactor. AllocationStrategy defines a strategy / limit for the number of pooled object to allocate.
|
| public Mono | allocator()
Implements reactor. Mono.
|
| public Clock | clock()
Implements reactor. java. to use to timestamp pool lifecycle events like allocation
and eviction, which can influence eg.
|
| public Function | destroyHandler()
Implements reactor. |
| public Duration | evictInBackgroundInterval()
Overrides default reactor. Duration representing
the interval at which such checks are made.
|
| public Scheduler | evictInBackgroundScheduler()
Overrides default reactor. Scheduler on
which these checks are made.
|
| public BiPredicate | evictionPredicate()
Implements reactor. BiPredicate that checks if a resource should be destroyed (true) or is still in a valid state
for recycling.
|
| public int | maxPending()
Implements reactor. |
| public PoolMetricsRecorder | metricsRecorder()
Implements reactor. PoolMetricsRecorder to use to collect instrumentation data of the Pool
implementations.
|
| public BiFunction | pendingAcquireTimer()
Overrides default reactor. Pool#acquire(Duration) call is made and the acquisition is pending.
|
| public Function | releaseHandler()
Implements reactor. released, defines a mechanism of resetting any lingering state of
the resource in order for it to become usable again.
|
| public boolean | reuseIdleResourcesInLruOrder()
Implements reactor. Pool#acquire() is performed.
|
| acquisitionScheduler | back to summary |
|---|---|
| protected final Scheduler acquisitionScheduler | |
| allocationStrategy | back to summary |
|---|---|
| protected final AllocationStrategy allocationStrategy | |
| allocator | back to summary |
|---|---|
| protected final Mono<POOLABLE> allocator | |
| clock | back to summary |
|---|---|
| protected final Clock clock | |
| destroyHandler | back to summary |
|---|---|
| protected final Function<POOLABLE, ? extends Publisher<Void>> destroyHandler | |
| evictInBackgroundInterval | back to summary |
|---|---|
| protected final Duration evictInBackgroundInterval | |
| evictInBackgroundScheduler | back to summary |
|---|---|
| protected final Scheduler evictInBackgroundScheduler | |
| evictionPredicate | back to summary |
|---|---|
| protected final BiPredicate<POOLABLE, PooledRefMetadata> evictionPredicate | |
| isIdleLRU | back to summary |
|---|---|
| protected final boolean isIdleLRU | |
| maxPending | back to summary |
|---|---|
| protected final int maxPending | |
| metricsRecorder | back to summary |
|---|---|
| protected final PoolMetricsRecorder metricsRecorder | |
| pendingAcquireTimer | back to summary |
|---|---|
| protected final BiFunction<Runnable, Duration, Disposable> pendingAcquireTimer | |
| releaseHandler | back to summary |
|---|---|
| protected final Function<POOLABLE, ? extends Publisher<Void>> releaseHandler | |
| DefaultPoolConfig | back to summary |
|---|---|
| public DefaultPoolConfig(Mono<POOLABLE> allocator, AllocationStrategy allocationStrategy, int maxPending, BiFunction<Runnable, Duration, Disposable> pendingAcquireTimer, Function<POOLABLE, ? extends Publisher<Void>> releaseHandler, Function<POOLABLE, ? extends Publisher<Void>> destroyHandler, BiPredicate<POOLABLE, PooledRefMetadata> evictionPredicate, Duration evictInBackgroundInterval, Scheduler evictInBackgroundScheduler, Scheduler acquisitionScheduler, PoolMetricsRecorder metricsRecorder, Clock clock, boolean isIdleLRU) | |
| DefaultPoolConfig | back to summary |
|---|---|
| protected DefaultPoolConfig(PoolConfig<POOLABLE> toCopy) Copy constructor for the benefit of specializations of
| |
| acquisitionScheduler | back to summary |
|---|---|
| public Scheduler acquisitionScheduler() Implements reactor. Doc from reactor. When set,
Defaults to
| |
| allocationStrategy | back to summary |
|---|---|
| public AllocationStrategy allocationStrategy() Implements reactor. Doc from reactor.
| |
| allocator | back to summary |
|---|---|
| public Mono Implements reactor. Doc from reactor. The asynchronous factory that produces new resources, represented as a
| |
| clock | back to summary |
|---|---|
| public Clock clock() Implements reactor. Doc from reactor. The
| |
| destroyHandler | back to summary |
|---|---|
| public Function Implements reactor. Doc from reactor. Defines a mechanism of resource destruction, cleaning up state and OS resources it could maintain (eg. off-heap objects, file handles, socket connections, etc...). For example, a database connection could need to cleanly sever the connection link by sending a message to the database.
| |
| evictInBackgroundInterval | back to summary |
|---|---|
| public Duration evictInBackgroundInterval() Overrides default reactor. Doc from reactor. If the pool is configured to perform regular eviction checks on the background, returns the
| |
| evictInBackgroundScheduler | back to summary |
|---|---|
| public Scheduler evictInBackgroundScheduler() Overrides default reactor. Doc from reactor. If the pool is configured to perform regular eviction checks on the background, returns the
| |
| evictionPredicate | back to summary |
|---|---|
| public BiPredicate Implements reactor. Doc from reactor. A
| |
| maxPending | back to summary |
|---|---|
| public int maxPending() Implements reactor. Doc from reactor. The maximum number of pending borrowers to enqueue before failing fast. 0 will immediately fail any acquire when no idle resource is available and the pool cannot grow. Use a negative number to deactivate.
| |
| metricsRecorder | back to summary |
|---|---|
| public PoolMetricsRecorder metricsRecorder() Implements reactor. Doc from reactor. The
| |
| pendingAcquireTimer | back to summary |
|---|---|
| public BiFunction Overrides default reactor. Doc from reactor. The function that defines how timeouts are scheduled when a
By default, the
| |
| releaseHandler | back to summary |
|---|---|
| public Function Implements reactor. Doc from reactor. When a resource is For example, a buffer could have a readerIndex and writerIndex that need to be flipped back to zero.
| |
| reuseIdleResourcesInLruOrder | back to summary |
|---|---|
| public boolean reuseIdleResourcesInLruOrder() Implements reactor. Doc from reactor. The order in which idle (aka available) resources should be used when the pool was
under-utilized and a new
| |