subscribe()

subscribe(topicURI, onEvent[, advancedOptions])

Subscribes for topicURI events.

Input Parameters:

  • topicURI. Required. A string that identifies the topic. Must meet a WAMP Spec URI requirements.

  • onEvent. Published event callback. Will be called on receiving published event with one hash-table parameter with following attributes:

    • argsList: array payload (maybe omitted)

    • argsDict: object payload (maybe omitted)

    • details: some publication options object.

  • advancedOptions. Optional parameters hash table. Must include any or all of the options:

    • match: string matching policy ("prefix"|"wildcard")

Returns promise:

  • Resolved with one hash-table parameter with following attributes:

    • topic

    • requestId

    • subscriptionId

    • subscriptionKey

  • Rejected with one of the Errors instances

Last updated