Interface Destination

All Known Implementing Classes:
DuplexHttpDestination, HttpDestination, MultiplexHttpDestination

public interface Destination
Destination represents the triple made of the getScheme(), the getHost() and the getPort().

Destination holds a pool of Connections, but allows to create unpooled connections if the application wants full control over connection management via newConnection(Promise).

Destinations may be obtained via HttpClient.resolveDestination(Request)

  • Method Details

    • getScheme

      String getScheme()
      the scheme of this destination, such as "http" or "https"
    • getHost

      String getHost()
      the host of this destination, such as "" or ""
    • getPort

      int getPort()
      the port of this destination such as 80 or 443
    • newConnection

      void newConnection(Promise<Connection> promise)
      Creates asynchronously a new, unpooled, Connection that will be returned at a later time through the given Promise.

      Use FuturePromise to wait for the connection:

       Destination destination = ...;
       FuturePromise<Connection> futureConnection = new FuturePromise<>();
       Connection connection = futureConnection.get(5, TimeUnit.SECONDS);
      promise - the promise of a new, unpooled, Connection