Skip to content

Commit

Permalink
use let for examples/consumer_listener.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kontotto committed Nov 14, 2023
1 parent 40c7624 commit 49d4e7b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/consumer_listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down

0 comments on commit 49d4e7b

Please sign in to comment.