Client: HubClient
HTTP Based client for WebSub content publishing to subscribers
Constructor
Initializes the websubhub:HubClient
.
1websubhub:HubClient hubClientEP = 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 subscription details for the
subscriber
- config *ClientConfiguration
The
websubhub:ClientConfiguration
for the underlying client
Remote Methods
notifyContentDistribution | Distributes the published content to the subscribers. |
notifyContentDistribution
function notifyContentDistribution(ContentDistributionMessage msg) returns ContentDistributionSuccess | SubscriptionDeletedError | Error
Isolated Function
Remote Function
Distributes the published content to the subscribers.
1ContentDistributionSuccess|SubscriptionDeletedError|error? publishUpdate = websubHubClientEP->notifyContentDistribution(2 {3 content: "This is sample content"4 }5);
Parameters
- msg 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