Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(webhook): describe the dispatch limiter as one process-wide pool

Yudhi Armyndharis9289772350fd
diff --git a/src/modules/webhook/webhook-delivery.service.ts b/src/modules/webhook/webhook-delivery.service.ts
index 178e157a8..6225109c1 100644
--- a/src/modules/webhook/webhook-delivery.service.ts
+++ b/src/modules/webhook/webhook-delivery.service.ts
@@ -148,9 +148,9 @@ export class WebhookDeliveryService implements OnModuleInit, OnModuleDestroy {
private readonly webhookQueue?: Queue<WebhookJobData>,
) {
this.queueEnabled = configService.get<boolean>('queue.enabled', false);
- // Bound fan-out: cap how many matching webhooks are delivered CONCURRENTLY for one event. Without
- // it, an event matching N webhooks opens N outbound sockets at once. Default 16
- // (WEBHOOK_DISPATCH_CONCURRENCY).
+ // Bound fan-out: cap how many webhook deliveries run CONCURRENTLY in this process. Every event and
+ // session shares this one pool, so an event matching N webhooks cannot open N outbound sockets at
+ // once. Default 16 (WEBHOOK_DISPATCH_CONCURRENCY).
const dispatchConcurrency = this.configService.get<number>('webhook.dispatchConcurrency', 16);
this.dispatchMaxQueued = this.configService.get<number>('webhook.dispatchMaxQueued', 1000);
this.dispatchLimiter = new ConcurrencyLimiter(dispatchConcurrency, this.dispatchMaxQueued);