下面列出了io.netty.channel.pool.ChannelPoolHandler#io.netty.channel.pool.ChannelHealthChecker 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public RntbdRequestManager(final ChannelHealthChecker healthChecker, final int pendingRequestLimit) {
checkArgument(pendingRequestLimit > 0, "pendingRequestLimit: %s", pendingRequestLimit);
checkNotNull(healthChecker, "healthChecker");
this.pendingRequests = new ConcurrentHashMap<>(pendingRequestLimit);
this.pendingRequestLimit = pendingRequestLimit;
this.healthChecker = healthChecker;
}
@Override
public Future<Boolean> isHealthy(Channel channel) {
// See if we've marked the channel as being non-usable first.
if (channelIsMarkedAsBeingBroken(channel))
return channel.eventLoop().newSucceededFuture(Boolean.FALSE);
// We haven't marked it broken, so fallback to the default channel health checker.
return ChannelHealthChecker.ACTIVE.isHealthy(channel);
}
RntbdClientChannelHandler(final Config config, final ChannelHealthChecker healthChecker) {
checkNotNull(healthChecker, "expected non-null healthChecker");
checkNotNull(config, "expected non-null config");
this.healthChecker = healthChecker;
this.config = config;
}
public ConnectionlessChannelPool(Bootstrap bootstrap, ChannelPoolHandler handler, ChannelHealthChecker healthCheck) {
super(bootstrap, handler, healthCheck);
}
public ConnectionlessChannelPool(Bootstrap bootstrap, ChannelPoolHandler handler, ChannelHealthChecker healthCheck, boolean releaseHealthCheck) {
super(bootstrap, handler, healthCheck, releaseHealthCheck);
}