Skip to content

Instantly share code, notes, and snippets.

@ayeshLK
Created March 12, 2023 08:23
Show Gist options
  • Save ayeshLK/606b36fdc6cf23b282fc437f401a73f4 to your computer and use it in GitHub Desktop.
Save ayeshLK/606b36fdc6cf23b282fc437f401a73f4 to your computer and use it in GitHub Desktop.
remote function onSubscriptionIntentVerified(readonly & websubhub:VerifiedSubscription subscription) returns error? {
if !validNotificationSenderExists(subscription.hubTopic) {
task:JobId notificationService = check startNotificationSender(subscription.hubTopic);
lock {
notificationSenders[subscription.hubTopic] = notificationService;
}
}
string newsReceiverId = string `${subscription.hubTopic}-${subscription.hubCallback}`;
lock {
newsReceiversCache[newsReceiverId] = subscription;
}
check startNotificationReceiver(subscription);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment