MCPcopy Create free account
hub / github.com/tiann/hapi / sendToNamespace

Method sendToNamespace

hub/src/push/pushService.ts:39–49  ·  view source on GitHub ↗
(namespace: string, payload: PushPayload)

Source from the content-addressed store, hash-verified

37 }
38
39 async sendToNamespace(namespace: string, payload: PushPayload): Promise<void> {
40 const subscriptions = this.store.push.getPushSubscriptionsByNamespace(namespace)
41 if (subscriptions.length === 0) {
42 return
43 }
44
45 const body = JSON.stringify(payload)
46 await Promise.all(subscriptions.map((subscription) => {
47 return this.sendToSubscription(namespace, subscription, body)
48 }))
49 }
50
51 private async sendToSubscription(
52 namespace: string,

Callers 3

sendPermissionRequestMethod · 0.80
sendReadyMethod · 0.80
sendTaskNotificationMethod · 0.80

Calls 2

sendToSubscriptionMethod · 0.95

Tested by

no test coverage detected