Skip to content

Commit

Permalink
use let for examples/consumer_listener.js (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
kontotto authored Nov 16, 2023
1 parent 40c7624 commit de6caa8
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 de6caa8

Please sign in to comment.