On Subscribe or Unsubscribe
AMPS provides modules for running actions when a client subscribes or unsubscribes.
The amps-action-on-subscribe
runs actions when an AMPS client enters a subscription command. The amps-action-on-unsubscribe
runs actions when an AMPS client unsubscribes (either by sending an explicit unsubscribe command or by disconnecting).
These modules require the following parameters:
Parameter | Description |
---|---|
| Specifies the topic or topic regular expression pattern to monitor for subscribe commands. |
| The message type of the topic to monitor for subscribe or unsubscribe. There is no default for this parameter. |
These modules add the following variables to the AMPS context:
Variable | Description |
---|---|
| The name of the topic specified by the subscribe or unsubscribe command. |
| The name of the client submitting the command. |
| The options on the subscription. |
| The filter for the subscription. |
Last updated