Top Description Inners Fields Constructors Methods
reactor.pool

pack-priv abstract Class AbstractPool<POOLABLE>

extends Object
implements InstrumentedPool<POOLABLE>, PoolMetrics
Class Inheritance
All Implemented Interfaces
reactor.pool.InstrumentedPool.PoolMetrics, reactor.pool.InstrumentedPool, reactor.pool.Pool, reactor.core.Disposable
Known Direct Subclasses
reactor.pool.SimpleDequePool
Imports
java.io.Closeable, .IOException, java.time.Clock, .Duration, java.util.concurrent.atomic.AtomicBoolean, .AtomicIntegerFieldUpdater, java.util.function.Function, org.reactivestreams.Publisher, .Subscription, reactor.core.CoreSubscriber, .Disposable, .Disposables, .Scannable, reactor.core.publisher.Mono, .Operators, reactor.util.Logger, reactor.util.annotation.Nullable, reactor.util.context.Context

An abstract base version of a Pool, mutualizing small amounts of code and allowing to build common related classes like AbstractPooledRef or Borrower.
Authors
Simon Baslé, Violeta Georgieva

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv abstract static class
AbstractPool.AbstractPooledRef<T>

An abstract base for most common statistics operator of PooledRef.

pack-priv static class
AbstractPool.Borrower<POOLABLE>

Common inner Subscription to be used to deliver poolable elements wrapped in AbstractPooledRef from an AbstractPool.

Field Summary

Modifier and TypeField and Description
pack-priv final Clock
pack-priv long
pack-priv final Logger
pack-priv final PoolMetricsRecorder
pack-priv final PoolConfig<POOLABLE>

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractPool(PoolConfig<POOLABLE> poolConfig, Logger logger)

Method Summary

Modifier and TypeMethod and Description
public int
acquiredSize()

Implements reactor.pool.InstrumentedPool.PoolMetrics.acquiredSize.

Measure the current number of resources that have been successfully acquired and are in active use, outside of the control of the pool until they're released back to it.
public int
allocatedSize()

Implements reactor.pool.InstrumentedPool.PoolMetrics.allocatedSize.

Measure the current number of allocated resources in the Pool, acquired or idle.
pack-priv abstract void
cancelAcquire(AbstractPool.Borrower<POOLABLE> borrower)

public PoolConfig<POOLABLE>
config()

Implements reactor.pool.Pool.config.

Return the pool's configuration.
private void
defaultDestroy(POOLABLE poolable)

pack-priv Mono<Void>

Returns:

the destroy Mono, which MUST be subscribed immediately
destroyPoolable
(AbstractPool.AbstractPooledRef<POOLABLE>
the PooledRef that is not part of the live set
ref
)

Apply the configured destroyHandler to get the destroy Mono AND return a permit to the AllocationStrategy, which assumes that the Mono will always be subscribed immediately.

pack-priv abstract void
doAcquire(AbstractPool.Borrower<POOLABLE> borrower)

Note to implementors: stop the Borrower countdown by calling Borrower#stopPendingCountdown(boolean) as soon as it is known that a resource is available or is in the process of being allocated.

pack-priv abstract boolean
elementOffer(POOLABLE element)

public int
getMaxAllocatedSize()

Implements reactor.pool.InstrumentedPool.PoolMetrics.getMaxAllocatedSize.

Get the maximum number of live resources this Pool will allow.
public int
getMaxPendingAcquireSize()

Implements reactor.pool.InstrumentedPool.PoolMetrics.getMaxPendingAcquireSize.

Get the maximum number of Pool#acquire() this Pool can queue in a pending state when no available resource is immediately handy (and the Pool cannot allocate more resources).
public abstract int
idleSize()

Redeclares reactor.pool.InstrumentedPool.PoolMetrics.idleSize.

Measure the current number of idle resources in the Pool.
public boolean
isInactiveForMoreThan(Duration duration)

Overrides default reactor.pool.InstrumentedPool.PoolMetrics.isInactiveForMoreThan.

A convenience way to check the pool is inactive, in the sense that acquiredSize(), idleSize(), pendingAcquireSize() and allocatedSize() are all at zero and that the last recorded interaction with the pool (secondsSinceLastInteraction()) was more than or exactly duration ago.
public InstrumentedPool.PoolMetrics
pack-priv void
public long
secondsSinceLastInteraction()

Overrides default reactor.pool.InstrumentedPool.PoolMetrics.secondsSinceLastInteraction.

Measure the duration in seconds since the pool was last interacted with in a meaningful way.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clockback to summary
pack-priv final Clock clock
lastInteractionTimestampback to summary
pack-priv long lastInteractionTimestamp
loggerback to summary
pack-priv final Logger logger
metricsRecorderback to summary
pack-priv final PoolMetricsRecorder metricsRecorder
poolConfigback to summary
pack-priv final PoolConfig<POOLABLE> poolConfig

Constructor Detail

AbstractPoolback to summary
pack-priv AbstractPool(PoolConfig<POOLABLE> poolConfig, Logger logger)

Method Detail

acquiredSizeback to summary
public int acquiredSize()

Implements reactor.pool.InstrumentedPool.PoolMetrics.acquiredSize.

Doc from reactor.pool.InstrumentedPool.PoolMetrics.acquiredSize.

Measure the current number of resources that have been successfully acquired and are in active use, outside of the control of the pool until they're released back to it. This number is only incremented after the resource has been successfully allocated and is about to be handed off to the subscriber of Pool#acquire().

Returns:int

the number of acquired resources

Annotations
@Override
allocatedSizeback to summary
public int allocatedSize()

Implements reactor.pool.InstrumentedPool.PoolMetrics.allocatedSize.

Doc from reactor.pool.InstrumentedPool.PoolMetrics.allocatedSize.

Measure the current number of allocated resources in the Pool, acquired or idle.

Returns:int

the total number of allocated resources managed by the Pool

Annotations
@Override
cancelAcquireback to summary
pack-priv abstract void cancelAcquire(AbstractPool.Borrower<POOLABLE> borrower)
configback to summary
public PoolConfig<POOLABLE> config()

Implements reactor.pool.Pool.config.

Doc from reactor.pool.Pool.config.

Return the pool's configuration.

Returns:PoolConfig<POOLABLE>

the PoolConfig

Annotations
@Override
defaultDestroyback to summary
private void defaultDestroy(POOLABLE poolable)
destroyPoolableback to summary
pack-priv Mono<Void> destroyPoolable(AbstractPool.AbstractPooledRef<POOLABLE> ref)

Apply the configured destroyHandler to get the destroy Mono AND return a permit to the AllocationStrategy, which assumes that the Mono will always be subscribed immediately.

Calls to this method MUST be guarded by AbstractPooledRef#markInvalidate().

Parameters
ref:AbstractPool.AbstractPooledRef<POOLABLE>

the PooledRef that is not part of the live set

Returns:Mono<Void>

the destroy Mono, which MUST be subscribed immediately

doAcquireback to summary
pack-priv abstract void doAcquire(AbstractPool.Borrower<POOLABLE> borrower)

Note to implementors: stop the Borrower countdown by calling Borrower#stopPendingCountdown(boolean) as soon as it is known that a resource is available or is in the process of being allocated.

elementOfferback to summary
pack-priv abstract boolean elementOffer(POOLABLE element)
getMaxAllocatedSizeback to summary
public int getMaxAllocatedSize()

Implements reactor.pool.InstrumentedPool.PoolMetrics.getMaxAllocatedSize.

Doc from reactor.pool.InstrumentedPool.PoolMetrics.getMaxAllocatedSize.

Get the maximum number of live resources this Pool will allow.

A Pool might be unbounded, in which case this method returns Integer#MAX_VALUE.

Returns:int

the maximum number of live resources that can be allocated by this Pool

Annotations
@Override
getMaxPendingAcquireSizeback to summary
public int getMaxPendingAcquireSize()

Implements reactor.pool.InstrumentedPool.PoolMetrics.getMaxPendingAcquireSize.

Doc from reactor.pool.InstrumentedPool.PoolMetrics.getMaxPendingAcquireSize.

Get the maximum number of Pool#acquire() this Pool can queue in a pending state when no available resource is immediately handy (and the Pool cannot allocate more resources).

A Pool pending queue might be unbounded, in which case this method returns Integer#MAX_VALUE.

Returns:int

the maximum number of pending acquire that can be enqueued by this Pool

Annotations
@Override
idleSizeback to summary
public abstract int idleSize()

Redeclares reactor.pool.InstrumentedPool.PoolMetrics.idleSize.

Doc from reactor.pool.InstrumentedPool.PoolMetrics.idleSize.

Measure the current number of idle resources in the Pool.

Note that some resources might be lazily evicted when they're next considered for an incoming Pool#acquire() call. Such resources would still count towards this method.

Returns:int

the number of idle resources

Annotations
@Override
isInactiveForMoreThanback to summary
public boolean isInactiveForMoreThan(Duration duration)

Overrides default reactor.pool.InstrumentedPool.PoolMetrics.isInactiveForMoreThan.

Doc from reactor.pool.InstrumentedPool.PoolMetrics.isInactiveForMoreThan.

A convenience way to check the pool is inactive, in the sense that acquiredSize(), idleSize(), pendingAcquireSize() and allocatedSize() are all at zero and that the last recorded interaction with the pool (secondsSinceLastInteraction()) was more than or exactly duration ago.

Returns:boolean

true if the pool can be considered inactive (see above), false otherwise

Annotations
@Override
metricsback to summary
public InstrumentedPool.PoolMetrics metrics()

Implements reactor.pool.InstrumentedPool.metrics.

Returns:InstrumentedPool.PoolMetrics

Doc from reactor.pool.InstrumentedPool.metrics.

a PoolMetrics object to be used to get live gauges about the Pool

Annotations
@Override
recordInteractionTimestampback to summary
pack-priv void recordInteractionTimestamp()
secondsSinceLastInteractionback to summary
public long secondsSinceLastInteraction()

Overrides default reactor.pool.InstrumentedPool.PoolMetrics.secondsSinceLastInteraction.

Doc from reactor.pool.InstrumentedPool.PoolMetrics.secondsSinceLastInteraction.

Measure the duration in seconds since the pool was last interacted with in a meaningful way. This is a best effort indicator of pool inactivity, provided the pool counters (acquiredSize(), idleSize(), pendingAcquireSize() and allocatedSize()) are also at zero.

The lower the duration, the greater the chances that an interaction could be occurring in parallel to this call. This is why the duration is truncated to the second. A pool implementation that cannot yet support this measurement MAY choose to return -1 seconds instead.

Interactions include background eviction, disposal of the pool, explicit pool warmup, resource acquisition and release (in the default implementation, any interaction triggering the drain loop)...

Returns:long

a number of seconds indicative of the time elapsed since last pool interaction

Annotations
@Override
reactor.pool back to summary

pack-priv abstract Class AbstractPool.AbstractPooledRef<T>

extends Object
implements PooledRef<T>, PooledRefMetadata
Class Inheritance
All Implemented Interfaces
reactor.pool.PooledRefMetadata, reactor.pool.PooledRef
Known Direct Subclasses
reactor.pool.SimpleDequePool.QueuePooledRef

An abstract base for most common statistics operator of PooledRef.
Author
Simon Baslé

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final Clock
pack-priv final long
pack-priv final PoolMetricsRecorder
pack-priv final T
pack-priv long
pack-priv volatile int
pack-priv static final AtomicIntegerFieldUpdater<AbstractPool.AbstractPooledRef<T>>
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractPooledRef(T
the newly created poolable
poolable
,
PoolMetricsRecorder
the recorder to use for metrics
metricsRecorder
,
Clock
the Clock to use for timestamps
clock
)

Use this constructor the first time a resource is created and wrapped in a PooledRef.

pack-priv
AbstractPooledRef(AbstractPool.AbstractPooledRef<T> oldRef)

Use this constructor when a resource is passed to another borrower.

Method Summary

Modifier and TypeMethod and Description
public int
acquireCount()

Implements reactor.pool.PooledRefMetadata.acquireCount.

Return the number of times the underlying pooled object has been used by consumers of the Pool, via either of Pool#acquire() or Pool#withPoolable(Function).
public long
allocationTimestamp()

Implements reactor.pool.PooledRefMetadata.allocationTimestamp.

Return a timestamp that denotes the order in which the PooledRef was created/allocated, or an equivalently totally-ordered positive number that can be used to compare in which order two references have been created (unless created within the same millisecond).
public long
idleTime()

Implements reactor.pool.PooledRefMetadata.idleTime.

Returns the wall-clock number of milliseconds since the reference was last released (or allocated, if it was never released).
public abstract Mono<Void>
invalidate()

Redeclares reactor.pool.PooledRef.invalidate.

Implementors MUST have the Mono call markInvalidate() upon subscription.
public long
lifeTime()

Implements reactor.pool.PooledRefMetadata.lifeTime.

Returns the age of the PooledRef: the wall-clock time (in milliseconds) since which the underlying object has been allocated.
pack-priv void
pack-priv boolean

Returns:

true if the ref could be marked as invalidated and tagged for destruction
markDestroy
()

Mark the ref for immediate destruction, even if it is released.

pack-priv boolean
pack-priv boolean

Returns:

true if the ref could be marked as invalidated, false if it was already either released or invalidated
markSoftInvalidate
()

Mark the ref for destruction in reaction to a user command (the PooledRef#invalidate() method).

public PooledRefMetadata
metadata()

Implements reactor.pool.PooledRef.metadata.

Returns a PooledRefMetadata object that holds more information about the reference (rather than the poolable()), like how many times it was acquired, its age (time since allocation), etc...
public T
poolable()

Implements reactor.pool.PooledRef.poolable.

Returns the wrapped POOLABLE.
public abstract Mono<Void>
release()

Redeclares reactor.pool.PooledRef.release.

Implementors MUST have the Mono call markReleased() upon subscription.
public long
releaseTimestamp()

Implements reactor.pool.PooledRefMetadata.releaseTimestamp.

Return a timestamp that denotes the order in which the PooledRef was last released, or an equivalently totally-ordered positive number that can be used to compare in which order two references have been released (unless released within the same millisecond).
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

acquireCountback to summary
pack-priv final int acquireCount
clockback to summary
pack-priv final Clock clock
creationTimestampback to summary
pack-priv final long creationTimestamp
metricsRecorderback to summary
pack-priv final PoolMetricsRecorder metricsRecorder
poolableback to summary
pack-priv final T poolable
releaseTimestampback to summary
pack-priv long releaseTimestamp
stateback to summary
pack-priv volatile int state
STATEback to summary
pack-priv static final AtomicIntegerFieldUpdater<AbstractPool.AbstractPooledRef<T>> STATE
Annotations
@SuppressWarnings:rawtypes
STATE_ACQUIREDback to summary
pack-priv static final int STATE_ACQUIRED
STATE_IDLEback to summary
pack-priv static final int STATE_IDLE
STATE_INVALIDATEDback to summary
pack-priv static final int STATE_INVALIDATED
STATE_RELEASEDback to summary
pack-priv static final int STATE_RELEASED

Constructor Detail

AbstractPooledRefback to summary
pack-priv AbstractPooledRef(T poolable, PoolMetricsRecorder metricsRecorder, Clock clock)

Use this constructor the first time a resource is created and wrapped in a PooledRef.

Parameters
poolable:T

the newly created poolable

metricsRecorder:PoolMetricsRecorder

the recorder to use for metrics

clock:Clock

the Clock to use for timestamps

AbstractPooledRefback to summary
pack-priv AbstractPooledRef(AbstractPool.AbstractPooledRef<T> oldRef)

Use this constructor when a resource is passed to another borrower.

Method Detail

acquireCountback to summary
public int acquireCount()

Implements reactor.pool.PooledRefMetadata.acquireCount.

Doc from reactor.pool.PooledRefMetadata.acquireCount.

Return the number of times the underlying pooled object has been used by consumers of the Pool, via either of Pool#acquire() or Pool#withPoolable(Function). The first time an object is allocated, this method returns 1, so the number of times it has been "recycled" can be deduced as acquireCount() - 1.

Returns:int

the number of times this object has been used by consumers of the pool

Annotations
@Override
allocationTimestampback to summary
public long allocationTimestamp()

Implements reactor.pool.PooledRefMetadata.allocationTimestamp.

Doc from reactor.pool.PooledRefMetadata.allocationTimestamp.

Return a timestamp that denotes the order in which the PooledRef was created/allocated, or an equivalently totally-ordered positive number that can be used to compare in which order two references have been created (unless created within the same millisecond).

Returns:long

the creation timestamp

Annotations
@Override
idleTimeback to summary
public long idleTime()

Implements reactor.pool.PooledRefMetadata.idleTime.

Doc from reactor.pool.PooledRefMetadata.idleTime.

Returns the wall-clock number of milliseconds since the reference was last released (or allocated, if it was never released). Can be used on resources that are not currently acquired to detect idle resources. A PooledRef that is currently acquired is required to return 0L.

Returns:long

the wall-clock number of milliseconds since the reference was last released (or allocated, if it was never released)

Annotations
@Override
invalidateback to summary
public abstract Mono<Void> invalidate()

Redeclares reactor.pool.PooledRef.invalidate.

Doc from reactor.pool.PooledRef.invalidate.

Implementors MUST have the Mono call markInvalidate() upon subscription.

Return a Mono that triggers the asynchronous invalidation of the POOLABLE when subscribed. The object is always discarded by the pool and not further reused.

This is useful when the unhealthy state of the resource (or lack of re-usability) is detected through the usage of the resource, as opposed to its exposed state.

Note that if release() has been invoked, this method should be no-op.

Annotations
@Override
lifeTimeback to summary
public long lifeTime()

Implements reactor.pool.PooledRefMetadata.lifeTime.

Doc from reactor.pool.PooledRefMetadata.lifeTime.

Returns the age of the PooledRef: the wall-clock time (in milliseconds) since which the underlying object has been allocated.

Returns:long

the wall-clock age (time since allocation) of the underlying object in milliseconds

Annotations
@Override
markAcquiredback to summary
pack-priv void markAcquired()
markDestroyback to summary
pack-priv boolean markDestroy()

Mark the ref for immediate destruction, even if it is released. To be used by internals that run on released references, eg. when detecting the pool is terminated.

Returns:boolean

true if the ref could be marked as invalidated and tagged for destruction

markReleasedback to summary
pack-priv boolean markReleased()
markSoftInvalidateback to summary
pack-priv boolean markSoftInvalidate()

Mark the ref for destruction in reaction to a user command (the PooledRef#invalidate() method). This method rejects state change if the ref has previously been released, preventing users to retain references and act on it post-release.

Returns:boolean

true if the ref could be marked as invalidated, false if it was already either released or invalidated

metadataback to summary
public PooledRefMetadata metadata()

Implements reactor.pool.PooledRef.metadata.

Doc from reactor.pool.PooledRef.metadata.

Returns a PooledRefMetadata object that holds more information about the reference (rather than the poolable()), like how many times it was acquired, its age (time since allocation), etc...

Note that if release() or invalidate() have been invoked, this method might return stale information.

Returns:PooledRefMetadata

the PooledRefMetadata for this PooledRef

Annotations
@Override
poolableback to summary
public T poolable()

Implements reactor.pool.PooledRef.poolable.

Doc from reactor.pool.PooledRef.poolable.

Returns the wrapped POOLABLE. This method is not thread-safe and the poolable should NEVER be accessed concurrently.

The reference is retained by the PooledRef but the object might be in an intermediate or invalid state when one of the release() or invalidate() methods have been previously called.

Returns:T

the poolable

Annotations
@Override
releaseback to summary
public abstract Mono<Void> release()

Redeclares reactor.pool.PooledRef.release.

Doc from reactor.pool.PooledRef.release.

Implementors MUST have the Mono call markReleased() upon subscription.

Return a Mono that, once subscribed, will release the POOLABLE back to the pool asynchronously. Once released, a reference is considered out of the control of the user and shouldn't be usable anymore. It is discouraged to use the underlying poolable() at this point, metadata() might become stale, and usage of both invalidate() and release() should be no-op.

This method is idempotent (subsequent subscriptions to the same Mono, or re-invocations of the method are NO-OP). It is also no-op if invalidate() has previously been invoked.

Returns:Mono<Void>

a Mono that will complete empty when the object has been released. In case of an error the object is always discarded

Annotations
@Override
releaseTimestampback to summary
public long releaseTimestamp()

Implements reactor.pool.PooledRefMetadata.releaseTimestamp.

Doc from reactor.pool.PooledRefMetadata.releaseTimestamp.

Return a timestamp that denotes the order in which the PooledRef was last released, or an equivalently totally-ordered positive number that can be used to compare in which order two references have been released (unless released within the same millisecond). If the PooledRef is currently acquired and held outside the pool, returns zero instead.

Returns:long

the last release timestamp, or zero if currently acquired

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
reactor.pool back to summary

pack-priv final Class AbstractPool.Borrower<POOLABLE>

extends AtomicBoolean
implements Scannable, Subscription, Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable, org.reactivestreams.Subscription, reactor.core.Scannable

Common inner Subscription to be used to deliver poolable elements wrapped in AbstractPooledRef from an AbstractPool.
Authors
Simon Baslé, Violeta Georgieva

Field Summary

Modifier and TypeField and Description
pack-priv final CoreSubscriber<? super AbstractPool.AbstractPooledRef<POOLABLE>>
pack-priv long
pack-priv final Duration
pack-priv final AbstractPool<POOLABLE>
pack-priv static final Disposable
pack-priv Disposable

Constructor Summary

AccessConstructor and Description
pack-priv
Borrower(CoreSubscriber<? super AbstractPool.AbstractPooledRef<POOLABLE>> actual, AbstractPool<POOLABLE> pool, Duration pendingAcquireTimeout)

Method Summary

Modifier and TypeMethod and Description
public void
cancel()

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
pack-priv Context
pack-priv void
pack-priv void
fail(Throwable error)

public void
request(long
the strictly positive number of elements to requests to the upstream Publisher
n
)

Implements org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
public Object
scanUnsafe(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Implements reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.
pack-priv void
stopPendingCountdown(boolean success)

Stop the countdown started when calling AbstractPool#doAcquire(Borrower).

public String
toString()

Overrides java.util.concurrent.atomic.AtomicBoolean.toString.

Returns the String representation of the current value.
Inherited from java.util.concurrent.atomic.AtomicBoolean:
compareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetgetgetAcquiregetAndSetgetOpaquegetPlainlazySetsetsetOpaquesetPlainsetReleaseweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

actualback to summary
pack-priv final CoreSubscriber<? super AbstractPool.AbstractPooledRef<POOLABLE>> actual
pendingAcquireStartback to summary
pack-priv long pendingAcquireStart
pendingAcquireTimeoutback to summary
pack-priv final Duration pendingAcquireTimeout
poolback to summary
pack-priv final AbstractPool<POOLABLE> pool
TIMEOUT_DISPOSEDback to summary
pack-priv static final Disposable TIMEOUT_DISPOSED
timeoutTaskback to summary
pack-priv Disposable timeoutTask

Constructor Detail

Borrowerback to summary
pack-priv Borrower(CoreSubscriber<? super AbstractPool.AbstractPooledRef<POOLABLE>> actual, AbstractPool<POOLABLE> pool, Duration pendingAcquireTimeout)

Method Detail

cancelback to summary
public void cancel()

Implements org.reactivestreams.Subscription.cancel.

Doc from org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.

Data may still be sent to meet previously signalled demand after calling cancel.

Annotations
@Override
currentContextback to summary
pack-priv Context currentContext()
deliverback to summary
pack-priv void deliver(AbstractPool.AbstractPooledRef<POOLABLE> poolSlot)
failback to summary
pack-priv void fail(Throwable error)
requestback to summary
public void request(long n)

Implements org.reactivestreams.Subscription.request.

Doc from org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.

It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more, it may be treated by the Publisher as "effectively unbounded".

Whatever has been requested can be sent by the Publisher so only signal demand for what can be safely handled.

A Publisher can send less than is requested if the stream ends but then must emit either Subscriber#onError(Throwable) or Subscriber#onComplete().

Parameters
n:long

the strictly positive number of elements to requests to the upstream Publisher

Annotations
@Override
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
scanUnsafeback to summary
public Object scanUnsafe(Scannable.Attr<T> key)

Implements reactor.core.Scannable.scanUnsafe.

Doc from reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the Attr key, implementors should take care to return values of the correct type, and return null if no specific value is available.

For public consumption of attributes, prefer using scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:Object

the value associated to the key for that specific component, or null if none.

Annotations
@Override
@Nullable
@SuppressWarnings:rawtypes
stopPendingCountdownback to summary
pack-priv void stopPendingCountdown(boolean success)

Stop the countdown started when calling AbstractPool#doAcquire(Borrower).

toStringback to summary
public String toString()

Overrides java.util.concurrent.atomic.AtomicBoolean.toString.

Doc from java.util.concurrent.atomic.AtomicBoolean.toString.

Returns the String representation of the current value.

Returns:String

the String representation of the current value

Annotations
@Override