Java API
interface

Connection

me.tamkungz.signals.connection.Connection

Version
0.2.1-SNAPSHOT
Java
21
Source file
me/tamkungz/signals/connection/Connection.java
Repository
View source ↗

Handle for a registered listener or bus registration.

<p>

{@link #disconnect()} is idempotent: calling it more than once is safe.

public interface Connection

Methods 7

all

static Connection all(Connection... connections)

Combines several connections so they can be disconnected together.

@param
connections connections to combine
@return
a group tracking every given connection

disconnected

static Connection disconnected()

Returns a connection that is already disconnected.

@return
a no-op, permanently disconnected connection

disconnect

@Override public void disconnect()

isConnected

@Override public boolean isConnected()

disconnect

void disconnect()

Stops this connection from receiving further values.

isConnected

boolean isConnected()

Tells whether this connection is still active.

@return
{@code true} until {@link #disconnect()} has been called

close

default void close()

Alias of {@link #disconnect()}.