Interface Connection

All Known Implementing Classes:
ConnectionGroup

public interface Connection
Handle for a registered listener or bus registration.

disconnect() is idempotent: calling it more than once is safe.

  • Method Summary

    Modifier and Type
    Method
    Description
    static Connection
    all(Connection... connections)
    Combines several connections so they can be disconnected together.
    default void
    Alias of disconnect().
    void
    Stops this connection from receiving further values.
    static Connection
    Returns a connection that is already disconnected.
    boolean
    Tells whether this connection is still active.
  • Method Details

    • all

      static Connection all(Connection... connections)
      Combines several connections so they can be disconnected together.
      Parameters:
      connections - connections to combine
      Returns:
      a group tracking every given connection
    • disconnected

      static Connection disconnected()
      Returns a connection that is already disconnected.
      Returns:
      a no-op, permanently disconnected connection
    • disconnect

      void disconnect()
      Stops this connection from receiving further values.
    • isConnected

      boolean isConnected()
      Tells whether this connection is still active.
      Returns:
      true until disconnect() has been called
    • close

      default void close()
      Alias of disconnect().