connect
public <T> Connection connect(SignalKey<T> key, Consumer<T> listener)Registers a listener for a key.
me.tamkungz.signals.internal.SignalRouter
Routes {@link SignalEnvelope}s arriving from GEB to the listeners registered for their key.
<p>
Internal: use {@link me.tamkungz.signals.SignalBus} instead. The class is public only because the
dispatcher GEB generates for {@link SignalEnvelope} lives in this package and must reach it.
public final class SignalRouter implements IListenerpublic <T> Connection connect(SignalKey<T> key, Consumer<T> listener)Registers a listener for a key.
public <T> Connection once(SignalKey<T> key, Consumer<T> listener)Registers a listener that is disconnected after its first value.
public int listenerCount(SignalKey<?> key)Counts the listeners connected to a key.
public void clear(SignalKey<?> key)Disconnects every listener of a key.
public void clear()Disconnects every listener of every key.
@Listen public void onSignal(SignalEnvelope<?> event)GEB entry point: delivers an envelope to the listeners of its key. <p> A throwing listener does not stop the others; the first failure is rethrown afterwards with the rest attached as suppressed exceptions.