Tabnine Logo
ChannelPool.offer
Code IndexAdd Tabnine to your IDE (free)

How to use
offer
method
in
com.ning.http.client.providers.netty.channel.pool.ChannelPool

Best Java code snippets using com.ning.http.client.providers.netty.channel.pool.ChannelPool.offer (Showing top 2 results out of 315)

origin: com.ning/async-http-client

public final void tryToOfferChannelToPool(Channel channel, boolean keepAlive, Object partitionKey) {
  if (channel.isConnected() && keepAlive && channel.isReadable()) {
    LOGGER.debug("Adding key: {} for channel {}", partitionKey, channel);
    Channels.setDiscard(channel);
    if (channelPool.offer(channel, partitionKey)) {
      if (maxConnectionsPerHostEnabled)
        channelId2PartitionKey.putIfAbsent(channel.getId(), partitionKey);
    } else {
      // rejected by pool
      closeChannel(channel);
    }
  } else {
    // not offered
    closeChannel(channel);
  }
}
origin: io.gatling/async-http-client

public final void tryToOfferChannelToPool(Channel channel, boolean keepAlive, String poolKey) {
  if (keepAlive && channel.isReadable()) {
    LOGGER.debug("Adding key: {} for channel {}", poolKey, channel);
    channelPool.offer(channel, poolKey);
    if (maxConnectionsPerHostEnabled)
      channelId2KeyPool.putIfAbsent(channel.getId(), poolKey);
    Channels.setDiscard(channel);
  } else {
    // not offered
    closeChannel(channel);
  }
}
com.ning.http.client.providers.netty.channel.poolChannelPooloffer

Javadoc

Add a connection to the pool

Popular methods of ChannelPool

  • destroy
    Destroy all connections that has been cached by this instance.
  • isOpen
    Return true if a connection can be cached. A implementation can decide based on some rules to allow
  • poll
    Remove the connection associated with the uri.
  • removeAll
    Remove all connections from the cache. A connection might have been associated with several uri.
  • flushPartition
    Flush a partition
  • flushPartitions
    Flush partitions based on a selector

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now