Interface Endpoint

    • Method Detail

      • connect

        void connect()
        Instruct this Endpoint to connect.

        This method is async and will return immediately. Use the other methods available to inspect the current state of the endpoint, signaling potential successful connection attempts.

      • disconnect

        void disconnect()
        Instruct this Endpoint to disconnect.

        This method is async and will return immediately. Use the other methods available to inspect the current state of the endpoint, signaling potential successful disconnection attempts.

      • send

        <R extends Request<? extends Response>> void send​(R request)
        Sends the request into this Endpoint.

        Note that there is no guarantee that the request will actually dispatched, based on the state this endpoint is in.

        Parameters:
        request - the request to send.
      • state

        EndpointState state()
        Returns the current state of this Endpoint.
        Returns:
        the state of this endpoint.
      • free

        boolean free()
        If this endpoint has currently one or more requests outstanding.
        Returns:
        true if free, false otherwise.
      • lastResponseReceived

        long lastResponseReceived()
        Holds the timestamp of the last response received (or 0 if no request ever sent).
        Returns:
        the timestamp of the last response received.