Interface Subscription

All Superinterfaces:
AutoCloseable

public interface Subscription extends AutoCloseable
The handle of a listener subscribed to an EventBus.

Closing it, for instance through try-with-resources, unsubscribes the listener.

Since:
0.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Unsubscribes the listener, exactly like unsubscribe().
    boolean
    Returns true until the listener is unsubscribed.
    void
    Unsubscribes the listener.
  • Method Details

    • isActive

      boolean isActive()
      Returns true until the listener is unsubscribed.
      Returns:
      true until the listener is unsubscribed
      Since:
      0.1.0
    • unsubscribe

      void unsubscribe()
      Unsubscribes the listener. Calling it again does nothing.
      Since:
      0.1.0
    • close

      default void close()
      Unsubscribes the listener, exactly like unsubscribe().
      Specified by:
      close in interface AutoCloseable
      Since:
      0.1.0