subscribe

open fun subscribe(obj: Any)(source)

Subscribe an object to the event bus, turning methods defined in it into listeners using @SubscribeEvent.

Parameters

obj

The object to subscribe.

See also


open fun <T : Event?> subscribe(event: Class<T>, handler: Consumer<T>)(source)

Subscribe a listener to the event bus.

Parameters

event

The class of the event to subscribe to.

handler

The Consumer to handle that event.