respond

open fun respond(properties: Map<String, Any>)

Meant to respond to a request event. By way of using Event.REQUEST_TOKEN to identify the listener created during the request, the respond fires an event 'directly' at said listener. Note that if the properties map does not contain Event.REQUEST_TOKEN, this method is a no-op. The intent for this behavior is that if an EventListener contains a call to respond, but there was no actual request, nothing should break (e.g. several 'play' event listeners, but only one is intended to respond to requests.

Parameters

properties

open fun respond(event: Event)

Convenience method to save the user from typing event.properties when responding

Parameters

event

An Event containing properties to pass on to the Request listener

See also