Subscription
A handle returned by lambda-based EventBus.subscribe overloads.
Call cancel to remove the handler from the bus. Also implements AutoCloseable for use in try-with-resources / Kotlin use { } blocks.
val sub = bus.subscribe<TickEvent> { tick() }
// later:
sub.cancel()Content copied to clipboard
Subscription sub = bus.subscribe(TickEvent.class, Priority.NORMAL, e -> tick());
// later:
sub.cancel();Content copied to clipboard