request

open fun request(eventType: String, listener: EventListener)

Attaches a listener and fires off an event of eventType, with the hope that there's a corresponding listener set to 'respond' to the listener specified in the request.

The flow looks something like:

request ->emit eventType -> eventType listener picks up event -> respond -> listener passed into request is called

After the listener is executed, it is removed

Parameters

eventType

The type of Event to emit and expect a response from

listener

A listener to process the response. After processing, the response should be removed

See also


open fun request(eventType: String, properties: Map<String, Any>, listener: EventListener)

Similar to above, except the properties map is passed along

Parameters

eventType

The type of Event to emit and expect a response from

properties

A Map of properties to pass along the event chain

listener

A listener to process the response. After processing, the response should be removed

See also