/** * {@inheritDoc} */ public boolean offer(Channel channel, Object partitionKey) { if (isClosed.get() || (!sslConnectionPoolEnabled && channel.pipeline().get(SslHandler.class) != null)) return false; long now = millisTime(); if (isTTLExpired(channel, now)) return false; boolean added = partitions.computeIfAbsent(partitionKey, PARTITION_COMPUTER).add(new IdleChannel(channel, now)); if (added) channelId2Creation.putIfAbsent(channelId(channel), new ChannelCreation(now, partitionKey)); return added; }
/** * {@inheritDoc} */ public boolean offer(Channel channel, Object partitionKey) { if (isClosed.get() || (!sslConnectionPoolEnabled && channel.pipeline().get(SslHandler.class) != null)) return false; long now = millisTime(); if (isTTLExpired(channel, now)) return false; boolean added = partitions.computeIfAbsent(partitionKey, PARTITION_COMPUTER).add(new IdleChannel(channel, now)); if (added) channelId2Creation.putIfAbsent(channelId(channel), new ChannelCreation(now, partitionKey)); return added; }
public boolean offer(Channel channel, Object partitionKey) { if (isClosed.get() || (!sslConnectionPoolEnabled && channel.getPipeline().get(SslHandler.class) != null)) return false; long now = millisTime(); if (isTTLExpired(channel, now)) return false; boolean added = partitions.computeIfAbsent(partitionKey, PARTITION_COMPUTER).add(new IdleChannel(channel, now)); if (added) channelId2Creation.putIfAbsent(channel.getId(), new ChannelCreation(now, partitionKey)); return added; }
public boolean offer(Channel channel, Object partitionKey) { if (isClosed.get() || (!sslConnectionPoolEnabled && channel.getPipeline().get(SslHandler.class) != null)) return false; long now = millisTime(); if (isTTLExpired(channel, now)) return false; boolean added = partitions.computeIfAbsent(partitionKey, PARTITION_COMPUTER).add(new IdleChannel(channel, now)); if (added) channelId2Creation.putIfAbsent(channel.getId(), new ChannelCreation(now, partitionKey)); return added; }