Package com.linkedin.alpini.base.pool
Interface AsyncPool<T>
-
- All Known Subinterfaces:
AsyncQOSPool<T>
- All Known Implementing Classes:
AsyncPoolImpl
,AsyncQOSPoolImpl
public interface AsyncPool<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
AsyncPool.LifeCycle<T>
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<T>
acquire()
static <T> AsyncPool<T>
create(AsyncPool.LifeCycle<T> lifeCycle, java.util.concurrent.Executor executor, int maxConcurrentCreate, int maxWaiters, int minimumEntities, int maximumEntities, long maxIdleTime, java.util.concurrent.TimeUnit maxIdleUnit)
void
dispose(T entity)
PoolStats
getPoolStats()
static <T> AsyncPool.LifeCycle<T>
rateLimitCreate(AsyncPool.LifeCycle<T> lifeCycle, java.util.concurrent.ScheduledExecutorService executor, long minimumTimeDelay, long maximumTimeDelay, long timeIncrement, java.util.concurrent.TimeUnit unit)
void
release(T entity)
default java.util.concurrent.CompletableFuture<java.lang.Void>
shutdownPool()
int
size()
void
start()
-
-
-
Method Detail
-
start
void start()
-
size
int size()
-
acquire
java.util.concurrent.CompletableFuture<T> acquire()
-
release
void release(T entity)
-
dispose
void dispose(T entity)
-
shutdownPool
default java.util.concurrent.CompletableFuture<java.lang.Void> shutdownPool()
-
getPoolStats
PoolStats getPoolStats()
-
create
static <T> AsyncPool<T> create(@Nonnull AsyncPool.LifeCycle<T> lifeCycle, @Nonnull java.util.concurrent.Executor executor, int maxConcurrentCreate, int maxWaiters, int minimumEntities, int maximumEntities, long maxIdleTime, @Nonnull java.util.concurrent.TimeUnit maxIdleUnit)
-
rateLimitCreate
static <T> AsyncPool.LifeCycle<T> rateLimitCreate(@Nonnull AsyncPool.LifeCycle<T> lifeCycle, @Nonnull java.util.concurrent.ScheduledExecutorService executor, long minimumTimeDelay, long maximumTimeDelay, long timeIncrement, @Nonnull java.util.concurrent.TimeUnit unit)
-
-