Package me.tamkungz.signals.connection
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 TypeMethodDescriptionstatic Connectionall(Connection... connections) Combines several connections so they can be disconnected together.default voidclose()Alias ofdisconnect().voidStops this connection from receiving further values.static ConnectionReturns a connection that is already disconnected.booleanTells whether this connection is still active.
-
Method Details
-
all
Combines several connections so they can be disconnected together.- Parameters:
connections- connections to combine- Returns:
- a group tracking every given 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:
trueuntildisconnect()has been called
-
close
default void close()Alias ofdisconnect().
-