TsgcWSPClient_WAMP › Methods › Publish
Broadcasts an event payload to every subscriber of the given topic, with optional exclude/eligible session lists.
procedure Publish(const aTopicURI, aEvent: string; const aExclude: string = ''; const aEligible: String = '');
| Name | Type | Description |
|---|---|---|
aTopicURI | const string | Fully-qualified URI of the topic, or a prefix:name CURIE previously registered with Prefix. |
aEvent | const string | Event payload, typically JSON. Delivered verbatim to every subscriber in the Event argument of OnEvent. |
aExclude | const string | Optional JSON array of session ids that must NOT receive the event (blacklist). Pass "true" to exclude the publisher itself when the server supports the eligible/excludeMe extension. |
aEligible | const String | Optional JSON array of session ids that are the only recipients allowed (whitelist). Leave empty to broadcast to all subscribers not covered by aExclude. |
Sends a WAMP v1 PUBLISH frame (type id 7). PubSub is fire-and-forget: there is no acknowledgement from the server and no delivery confirmation to the publisher. The event fans out to every session whose Subscribe URI matches aTopicURI exactly (WAMP v1 does not support wildcard topics). Use aExclude and aEligible together to implement private rooms or to prevent echo-back to the sender.
WAMP.Publish('http://example.com/chat#lobby',
'{"user":"alice","text":"hello"}');