android-components / mozilla.components.feature.push / MessageBus

MessageBus

class MessageBus<T : Enum<T>, M> : Bus<T, M> (source)

An implementation of Bus where the event type is restricted to an enum.

Constructors

Name Summary
<init> MessageBus()
An implementation of Bus where the event type is restricted to an enum.

Functions

Name Summary
notifyObservers fun notifyObservers(type: T, message: M): Unit
Notifies all registered observers of a particular message.
register fun register(type: T, observer: Observer<T, M>): Unit
fun register(type: T, observer: Observer<T, M>, owner: LifecycleOwner, autoPause: Boolean): Unit
Registers an observer to get notified about events.
unregister fun unregister(type: T, observer: Observer<T, M>): Unit
Unregisters an observer to stop getting notified about events.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.