KeelEventBus

interface KeelEventBus(source)

Event bus interface for inter-plugin communication. Uses MutableSharedFlow to allow plugins to publish and subscribe to events.

Usage:

  • Publishers: eventBus.emit(MyEvent(...))

  • Subscribers: eventBus.events.collect { event -> ... }

Properties

Link copied to clipboard
abstract val events: SharedFlow<KeelEvent>

The shared flow of all events published to the bus.

Functions

Link copied to clipboard
abstract suspend fun publish(event: KeelEvent)

Publish an event to all subscribers.

Link copied to clipboard
abstract fun <T : KeelEvent> subscribe(eventClass: Class<T>): SharedFlow<T>

Subscribe to events of a specific type.