W - Type of object that is written to the client using this factory.R - Type of object that is read from the the client using this factory.public final class PooledConnectionProviderImpl<W,R> extends PooledConnectionProvider<W,R>
PooledConnectionProvider that pools connections.
Following are the key parameters:
PoolLimitDeterminationStrategy: A strategy to determine whether a new physical connection should be
created as part of the user request.PoolConfig.getIdleConnectionsCleanupTimer(): The schedule for cleaning up idle connections in the pool.PoolConfig.getMaxIdleTimeMillis(): Maximum time a connection can be idle in this pool.| Constructor and Description |
|---|
PooledConnectionProviderImpl(PoolConfig<W,R> poolConfig,
HostConnector<W,R> hostConnector) |
| Modifier and Type | Method and Description |
|---|---|
rx.Observable<java.lang.Void> |
discard(PooledConnection<?,?> connection)
Discards the passed connection from the pool.
|
rx.Observable<Connection<R,W>> |
newConnectionRequest()
Returns an
Observable that emits a single connection every time it is subscribed. |
rx.Observable<java.lang.Void> |
release(PooledConnection<?,?> connection)
Releases the passed connection back to the owner, for reuse.
|
create, createBounded, createUnboundedpublic PooledConnectionProviderImpl(PoolConfig<W,R> poolConfig, HostConnector<W,R> hostConnector)
public rx.Observable<Connection<R,W>> newConnectionRequest()
ConnectionProviderObservable that emits a single connection every time it is subscribed.Observable that emits a single connection every time it is subscribed.public rx.Observable<java.lang.Void> release(PooledConnection<?,?> connection)
PooledConnection.Ownerconnection - Connection to be released.Observable representing result of the release. Every subscription to this, releases the
connection.public rx.Observable<java.lang.Void> discard(PooledConnection<?,?> connection)
PooledConnection.Ownerconnection - The connection to discard.Observable indicating the result of the discard (which usually results in a close()).
Every subscription to this Observable will discard the connection.