Client: HubClient
HTTP Based client for WebSub content publishing to subscribers
Constructor
Initializes the websubhub:HubClient
.
1websubhub:HubClient hubClientEP = check new({2 hub: "https://hub.com",3 hubMode: "subscribe",4 hubCallback: "http://subscriber.com/callback",5 hubTopic: "https://topic.com",6 hubSecret: "key"7});
init (Subscription subscription, *ClientConfiguration config)
- subscription Subscription
Original
websubhub:Subscription
record, which contains the details of thesubscriber
- config *ClientConfiguration
The
websubhub:ClientConfiguration
for the underlying client
Remote Methods
notifyContentDistribution | Distributes the published content to the subscribers. |
notifyContentDistribution
function notifyContentDistribution(ContentDistributionMessage message) returns ContentDistributionSuccess | SubscriptionDeletedError | Error
Isolated Function
Remote Function
Distributes the published content to the subscribers.
1ContentDistributionSuccess publishUpdate = check websubHubClientEP->notifyContentDistribution({ content: "This is sample content" });
Parameters
- message ContentDistributionMessage
Content to be distributed to the topic subscriber
Return Type
(ContentDistributionSuccess | SubscriptionDeletedError | Error)An websubhub:Error
if an exception occurred, a websubhub:SubscriptionDeletedError
if the subscriber responded with HTTP 410
,
or else a websubhub:ContentDistributionSuccess
for successful content delivery