subscribe
Registers all instance methods on subscriber annotated with @Subscribe.
Methods handling event types outside E are silently ignored at dispatch time. Calling this with the same object more than once is idempotent.
Registers a lambda handler for event type T and returns a Subscription token.
Kotlin callers should prefer the reified inline overload:
val sub = networkBus.subscribe<PacketReceived>(async = true) { e -> handle(e) }Return
a Subscription whose Subscription.cancel removes this handler.
Parameters
If true, dispatches on the bus's executor; falls back to sync if none configured.
Registers a lambda handler for event type T with synchronous dispatch.
Preserves binary compatibility with callers that predate the async parameter.
Return
a Subscription whose Subscription.cancel removes this handler.
Registers a Consumer handler for event type T and returns a Subscription token.
Java callers use plain void lambdas:
networkBus.subscribe(PacketReceived.class, Priority.NORMAL, true, e -> handle(e.bytes));Return
a Subscription whose Subscription.cancel removes this handler.
Parameters
If true, dispatches on the bus's executor; falls back to sync if none configured.
Registers a Consumer handler for event type T with synchronous dispatch.
Preserves binary compatibility with callers that predate the async parameter.
Return
a Subscription whose Subscription.cancel removes this handler.