From 49d4e7b4c213a4e9f4eb8d86daedb90e6f1e3bfd Mon Sep 17 00:00:00 2001 From: Shuta Kondo Date: Wed, 15 Nov 2023 08:54:05 +0900 Subject: [PATCH] use let for examples/consumer_listener.js --- examples/consumer_listener.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/consumer_listener.js b/examples/consumer_listener.js index df3c4ed5..4fc3b56e 100644 --- a/examples/consumer_listener.js +++ b/examples/consumer_listener.js @@ -19,9 +19,13 @@ const Pulsar = require('../'); +// It will be released and disconnected when there are no references, +// so declare it with let. +let client; + (async () => { // Create a client - const client = new Pulsar.Client({ + client = new Pulsar.Client({ serviceUrl: 'pulsar://localhost:6650', operationTimeoutSeconds: 30, });