diff --git a/README.md b/README.md index 8caf680..b6c1037 100644 --- a/README.md +++ b/README.md @@ -113,3 +113,7 @@ const streamContext = createResumableStreamContext({ - When a second resumable stream is invoked for a given `streamId`, it publishes a messages to alert the producer that it would like to receive the stream. - The second consumer now expects messages of stream content via the pubsub. - The producer receives the request, and starts publishing the buffered messages and then publishes additional chunks of the stream. + +## Debugging + +Set the `DEBUG` environment variable to `resumable-stream:*` to see debug logs. diff --git a/src/runtime.ts b/src/runtime.ts index 677cae4..90c6661 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -331,10 +331,23 @@ function incrOrDone(publisher: Publisher, key: string): Promise ns.trim()); + return namespaces.some(ns => + ns === '*' || + ns === 'resumable-stream' || + ns.startsWith('resumable-stream:') + ); } + function debugLog(...messages: unknown[]) { if (isDebug()) { console.log(...messages);