EventEmitter

interface EventEmitter

Defines the public facing api for classes that wish to emit events. See EventEmitterImpl for the main implementation method descriptions.

See also

Inheritors

Functions

Link copied to clipboard
abstract fun disable()
Disables listener registration and event emitting.
Link copied to clipboard
abstract fun emit(eventType: String)
Emits an Event.
abstract fun emit(eventType: String, properties: Map<String, Any>)
Emits an event with a dynamic properties Map.
Link copied to clipboard
abstract fun emitNow(eventType: String, properties: Map<String, Any>)
Emits an event immediately instead of waiting for the handler.
Link copied to clipboard
abstract fun enable()
Enables listener registration and event emitting.
Link copied to clipboard
abstract fun off()
De-register all listeners.
abstract fun off(eventType: String, token: Int)
Unregister a listener from listening to an event type.
Link copied to clipboard
abstract fun on(eventType: String, listener: EventListener): Int
Register an event listener to be called when an EventType is emitted.
Link copied to clipboard
abstract fun once(eventType: String, listener: EventListener): Int
Similar to on, except that the listener will be removed after processing one event.
Link copied to clipboard
abstract fun request(eventType: String, listener: EventListener)
Requests a response from the first listener to respond.
abstract fun request(eventType: String, properties: Map<String, Any>, listener: EventListener)
Request a response from the first listener to respond.
Link copied to clipboard
abstract fun respond(event: Event)
abstract fun respond(properties: Map<String, Any>)
Respond to a request.