Pool on whether or not it is possible to invoke the resource allocator.
See PoolBuilder#sizeBetween(int, int) and PoolBuilder#sizeUnbounded() for pre-made strategies.
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: an ESTIMATED count of how many more resources can currently be allocatedBest-effort peek at the state of the strategy which indicates roughly how many more resources can currently be allocated. |
| public int | Returns: the actual number of new resources that MUST be created, can be 0 and can be more thandesiredthe desired number of new resources desired)Try to get the permission to allocate a |
| public int | Returns: a best estimate of the number of permits currently granted, between 0 andInteger#MAX_VALUE
|
| public int | Returns: the maximum number of permits this strategy can grant in total, orInteger#MAX_VALUE for unbounded
|
| public int | Returns: the minimum number of permits this strategy tries to maintain, or0Return the minimum number of permits this strategy tries to maintain granted
(reflecting a minimal size for the pool), or |
| public void | returnPermits(int returned)
Update the strategy to indicate that N resources were discarded from the |
| public default int | Returns: The concurrency level used when the allocator is subscribed to during the warmup phase, must be positive,1 by defaultReturn the concurrency level used when the allocator is subscribed to during the warmup phase, if any. |
| estimatePermitCount | back to summary |
|---|---|
| public int estimatePermitCount() Best-effort peek at the state of the strategy which indicates roughly how many more resources can currently be
allocated. Should be paired with
| |
| getPermits | back to summary |
|---|---|
| public int getPermits(int desired) Try to get the permission to allocate a
For the warming up case, the typical pattern would be to call this method with a
| |
| permitGranted | back to summary |
|---|---|
public int permitGranted()
| |
| permitMaximum | back to summary |
|---|---|
public int permitMaximum()
| |
| permitMinimum | back to summary |
|---|---|
| public int permitMinimum() Return the minimum number of permits this strategy tries to maintain granted
(reflecting a minimal size for the pool), or
| |
| returnPermits | back to summary |
|---|---|
| public void returnPermits(int returned) Update the strategy to indicate that N resources were discarded from the
Some strategy MIGHT throw an | |
| warmupParallelism | back to summary |
|---|---|
| public default int warmupParallelism() Return the concurrency level used when the allocator is subscribed to during the warmup phase, if any.
The number of resources created concurrently will not exceed the value returned by Defaults to 1
| |