Skip to content

Commit 5ab19ec

Browse files
Allow closing the stream
Signed-off-by: Xavier Geerinck <[email protected]>
1 parent a06edbc commit 5ab19ec

File tree

1 file changed

+4
-1
lines changed
  • daprdocs/content/en/js-sdk-docs/js-server

1 file changed

+4
-1
lines changed

daprdocs/content/en/js-sdk-docs/js-server/_index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,12 @@ const serverPort = "5051";
222222

223223
async function start() {
224224
const client = new DaprClient(daprHost, daprPort, CommunicationProtocolEnum.GRPC);
225-
await client.configuration.subscribeWithKeys("config-redis", ["myconfigkey1", "myconfigkey2"], () => {
225+
const stream = await client.configuration.subscribeWithKeys("config-redis", ["myconfigkey1", "myconfigkey2"], () => {
226226
// Received a key update
227227
});
228+
229+
// When you are ready to stop listening, call teh following
230+
await stream.close();
228231
}
229232

230233
start().catch((e) => {

0 commit comments

Comments
 (0)