Class: ReqResp

ReqResp()

This class implements a request/response broker that can be used to actively request information. This would typically be used with a technology such as HTTP.

Constructor

new ReqResp()

Source:

Methods

register(topic, key, handler) → {void}

Parameters:
Name Type Description
topic * The topic that the handler should be registered for.
key * The value that is used to uniquely identify the handler.
handler handleRequest The callback that should handle the request.
Source:
Returns:
Type
void

request(topic, payload) → {Array.<*>}

Parameters:
Name Type Description
topic * The topic that should be requested.
payload * The payload that should be passed to the topic handler callback.
Source:
Returns:
An array of the values returned by the registered handlers.
Type
Array.<*>

unregister(topic, key) → {boolean}

Parameters:
Name Type Description
topic * The topic that the handler should be unregistered from.
key * The value that was used to uniquely identify the handler when subscribing.
Source:
Returns:
True if unregistering was successful, false otherwise.
Type
boolean