acquireHealthyFromPoolOrNew() — netty Function Reference
Architecture documentation for the acquireHealthyFromPoolOrNew() function in SimpleChannelPool.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD c89f5af0_c810_693d_6240_cf574acc05b1["acquireHealthyFromPoolOrNew()"] e441b5b0_fbd9_848c_9624_3e21f7c56e58["SimpleChannelPool"] c89f5af0_c810_693d_6240_cf574acc05b1 -->|defined in| e441b5b0_fbd9_848c_9624_3e21f7c56e58 4dfbb6a3_fad3_e1b0_2d99_91320e356877["acquire()"] 4dfbb6a3_fad3_e1b0_2d99_91320e356877 -->|calls| c89f5af0_c810_693d_6240_cf574acc05b1 7ba4c5b6_3e78_dd98_af42_a908940f0803["notifyHealthCheck()"] 7ba4c5b6_3e78_dd98_af42_a908940f0803 -->|calls| c89f5af0_c810_693d_6240_cf574acc05b1 d8986b0c_0cd0_31a4_8611_1debe6366195["notifyConnect()"] c89f5af0_c810_693d_6240_cf574acc05b1 -->|calls| d8986b0c_0cd0_31a4_8611_1debe6366195 b79f6ac0_3d07_2cc1_f3d6_7ca1488e3fa0["doHealthCheck()"] c89f5af0_c810_693d_6240_cf574acc05b1 -->|calls| b79f6ac0_3d07_2cc1_f3d6_7ca1488e3fa0 style c89f5af0_c810_693d_6240_cf574acc05b1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport/src/main/java/io/netty/channel/pool/SimpleChannelPool.java lines 170–200
private Future<Channel> acquireHealthyFromPoolOrNew(final Promise<Channel> promise) {
try {
final Channel ch = pollChannel();
if (ch == null) {
// No Channel left in the pool bootstrap a new Channel
Bootstrap bs = bootstrap.clone();
bs.attr(POOL_KEY, this);
ChannelFuture f = connectChannel(bs);
if (f.isDone()) {
notifyConnect(f, promise);
} else {
f.addListener((ChannelFutureListener) future -> notifyConnect(future, promise));
}
} else {
EventLoop loop = ch.eventLoop();
if (loop.inEventLoop()) {
doHealthCheck(ch, promise);
} else {
loop.execute(new Runnable() {
@Override
public void run() {
doHealthCheck(ch, promise);
}
});
}
}
} catch (Throwable cause) {
promise.tryFailure(cause);
}
return promise;
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does acquireHealthyFromPoolOrNew() do?
acquireHealthyFromPoolOrNew() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/pool/SimpleChannelPool.java.
Where is acquireHealthyFromPoolOrNew() defined?
acquireHealthyFromPoolOrNew() is defined in transport/src/main/java/io/netty/channel/pool/SimpleChannelPool.java at line 170.
What does acquireHealthyFromPoolOrNew() call?
acquireHealthyFromPoolOrNew() calls 2 function(s): doHealthCheck, notifyConnect.
What calls acquireHealthyFromPoolOrNew()?
acquireHealthyFromPoolOrNew() is called by 2 function(s): acquire, notifyHealthCheck.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free