W - Type of object that is written to the client using this holder.R - Type of object that is read from the the client using this holder.public class PreferCurrentEventLoopHolder<W,R> extends IdleConnectionsHolder<W,R>
IdleConnectionsHolder implementation that can identify if the calling thread is an EventLoop in
the provided PreferCurrentEventLoopGroup and prefers a connection registered with the calling
EventLoop.
If the calling thread is not an EventLoop in the provided PreferCurrentEventLoopGroup then
poll() and peek() will iterate over connections from all EventLoops however
add(PooledConnection) will attempt to find the EventLoop of the added PooledConnection. If
the EventLoop of the connection does not belong to the provided PreferCurrentEventLoopGroup then the
connection will be discarded.| Modifier and Type | Class and Description |
|---|---|
static interface |
PreferCurrentEventLoopHolder.IdleConnectionsHolderFactory<W,R> |
| Modifier and Type | Method and Description |
|---|---|
void |
add(PooledConnection<R,W> toAdd)
Adds the passed connection to this holder.
|
rx.Observable<PooledConnection<R,W>> |
peek()
Creates a stream of idle connections where every item sent on to the stream is NOT removed from the
underlying idle connections pool.
|
rx.Observable<PooledConnection<R,W>> |
poll()
Creates a stream of idle connections where every item sent on to the stream is removed from the underlying
idle connections pool.
|
rx.Observable<PooledConnection<R,W>> |
pollThisEventLoopConnections()
Creates a stream of idle connections where every item sent on to the stream is removed from the underlying
idle connections pool.
|
boolean |
remove(PooledConnection<R,W> toRemove)
Removes the passed connection from this holder.
|
public rx.Observable<PooledConnection<R,W>> poll()
IdleConnectionsHolderpoll in class IdleConnectionsHolder<W,R>public rx.Observable<PooledConnection<R,W>> pollThisEventLoopConnections()
IdleConnectionsHolderEventLoop known to this holder.
Otherwise, it should return an empty stream.pollThisEventLoopConnections in class IdleConnectionsHolder<W,R>public rx.Observable<PooledConnection<R,W>> peek()
IdleConnectionsHolderIdleConnectionsHolder.remove(PooledConnection) must
be called for that connection.peek in class IdleConnectionsHolder<W,R>public void add(PooledConnection<R,W> toAdd)
IdleConnectionsHolderadd in class IdleConnectionsHolder<W,R>toAdd - Connection to add.public boolean remove(PooledConnection<R,W> toRemove)
IdleConnectionsHolderremove in class IdleConnectionsHolder<W,R>toRemove - Connection to remove.