org.apache.hc.client5.http.io

## Interface ConnectionRequest

All Superinterfaces:
  org.apache.hc.core5.concurrent.Cancellable

    public interface ConnectionRequest
    extends org.apache.hc.core5.concurrent.Cancellable

Represents a request for a `HttpClientConnection` whose life cycle is managed by a connection manager.

Since:
  4.3

### Method Summary

Methods
`org.apache.hc.core5.http.io.HttpClientConnection` `get(long timeout, TimeUnit tunit)` Obtains a connection within a given time.

### Methods inherited from interface org.apache.hc.core5.concurrent.Cancellable

`cancel`

### Method Detail

#### get

    org.apache.hc.core5.http.io.HttpClientConnection get(long timeout,
                                                       TimeUnit tunit)
                                                         throws InterruptedException,
                                                                ExecutionException,
                                                                ConnectionPoolTimeoutException

Obtains a connection within a given time. This method will block until a connection becomes available, the timeout expires, or the connection manager is shut down. Timeouts are handled with millisecond precision. If `Cancellable.cancel()` is called while this is blocking or before this began, an `InterruptedException` will be thrown.

Parameters:
  `timeout` - the timeout, 0 or negative for no timeout
  `tunit` - the unit for the `timeout`, may be `null` only if there is no timeout
Returns:
  a connection that can be used to communicate along the given route
Throws:
  `ConnectionPoolTimeoutException` - in case of a timeout
  `InterruptedException` - if the calling thread is interrupted while waiting
  `ExecutionException`