The Hub instance to which this will subscribe.
If passed, this will be called with the results array. If not present, this function will instead return a Promise which resolves to the results array.
An array of route descriptors (see Hub for details on valid route descriptors).
Time in milliseconds to wait for a message before timing out.
Wait for the first message(s) sent to the specified routes, within the specified timeout.
Returns an array of results once one of the following is true:
In either case, the ultimate results will be an array containing tuples of the form
[routeName, payload]for every route which successfully produces a message. If any routes timed out or otherwise failed, theresultsobject will have afailedproperty, containing an array of tuples in the form[routeName, reasonForFailure].This function captures the first messages it receives on each route. If you want the latest (or last) messages for each route, use latest.
waitTime is passed to
setTimeout()as the delay, which means it is bound by the limitations inherent in that mechanism. There are a few values that will trigger special behavior:-1- This is the default value. This value prevents the listener from every timing out: It will wait forever if it never receives an event. This is notsetTimeout()behavior; if this value is passed,setTimeout()is simply never called.0- The timeout will expire in the next event cycle. This is usually close to "immediately," but will usually take more than 0 actual milliseconds. In the context of denden's messaging, this will usually only return something if there are messages in the queue already.214748364(or greater) - The actual number here varies, but this is the maximum delay value. Setting this value, or higher, will result in odd behavior—i.e. overflowing to 0 or negative numbers, etc. This is 20+ days, so it's very unlikely you would ever need to set a value this high. In most cases, you would probably just want to use-1instead.