Skip to content

Commit 74cc797

Browse files
committed
build: release v2.4.0
1 parent 84de732 commit 74cc797

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

dist/client.cjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,9 @@ var PubSubApiClient = class {
521521
eventEmitter.emit("error", error);
522522
});
523523
subscription.on("status", (status) => {
524-
this.#logger.info(`gRPC stream status: ${status}`);
524+
this.#logger.info(
525+
`gRPC stream status: ${JSON.stringify(status)}`
526+
);
525527
eventEmitter.emit("status", status);
526528
});
527529
return eventEmitter;
@@ -569,6 +571,10 @@ var PubSubApiClient = class {
569571
});
570572
}
571573
}
574+
close() {
575+
this.#logger.info("closing gRPC stream");
576+
this.#client.close();
577+
}
572578
async #getEventSchema(topicName) {
573579
let schema = this.#schemaChache.get(topicName);
574580
if (!schema) {

dist/client.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ export default class PubSubApiClient {
6868
* @returns {Promise<PublishResult>} Promise holding a PublishResult object with replayId and correlationKey
6969
*/
7070
publish(topicName: string, payload: any, correlationKey?: string): Promise<PublishResult>;
71+
/**
72+
* Closes the gRPC connection. The client will no longer receive events for any topic.
73+
*/
74+
close(): void;
7175
#private;
7276
}
7377
export type Schema = {

dist/client.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/client.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,9 @@ var PubSubApiClient = class {
493493
eventEmitter.emit("error", error);
494494
});
495495
subscription.on("status", (status) => {
496-
this.#logger.info(`gRPC stream status: ${status}`);
496+
this.#logger.info(
497+
`gRPC stream status: ${JSON.stringify(status)}`
498+
);
497499
eventEmitter.emit("status", status);
498500
});
499501
return eventEmitter;
@@ -541,6 +543,10 @@ var PubSubApiClient = class {
541543
});
542544
}
543545
}
546+
close() {
547+
this.#logger.info("closing gRPC stream");
548+
this.#client.close();
549+
}
544550
async #getEventSchema(topicName) {
545551
let schema = this.#schemaChache.get(topicName);
546552
if (!schema) {

0 commit comments

Comments
 (0)