dis+/node_modules/@google-cloud/pubsub/build/src/pubsub.js
/**
     * Closes out this object, releasing any server connections. Note that once
     * you close a PubSub object, it may not be used again. Any pending operations
     * (e.g. queued publish messages) will fail. If you have topic or subscription
     * objects that may have pending operations, you should call close() on those
     * first if you want any pending messages to be delivered correctly. The
     * PubSub class doesn't track those.
     *
     * @callback EmptyCallback
     * @returns {Promise<void>}
     */
Closes out this object, releasing any server connections. Note that once
you close a PubSub object, it may not be used again. Any pending operations
will fail. If you have topic or subscription
objects that may have pending operations, you should call close() on those
first if you want any pending messages to be delivered correctly. The
PubSub class doesn't track those.

@callback EmptyCallback
@returns {Promise}
Closes out this object releasing any server connections . Note that once you close a PubSub object it may not be used again . Any pending operations will fail . If you have topic or subscription objects that may have pending operations you should call close () on those first if you want any pending messages to be delivered correctly . The PubSub class doesn ' t track those . @callback EmptyCallback @returns { Promise }
close(callback) {
        const definedCallback = callback || (() => { });
        if (this.isOpen) {
            this.isOpen = false;
            this.closeAllClients_()
                .then(() => { var _a; return (_a = this.schemaClient) === null || _a === void 0 ? void 0 : _a.close(); })
                .then(() => {
                definedCallback(null);
            })
                .catch(definedCallback);
        }
        else {
            definedCallback(null);
        }
    }
close ( callback ) { const definedCallback = callback || ( ( ) => { } ) ; if ( this . isOpen ) { this . isOpen = false ; this . closeAllClients_ ( ) . then ( ( ) => { var _a ; return ( _a = this . schemaClient ) === null || _a === void 0 ? void 0 : _a . close ( ) ; } ) . then ( ( ) => { definedCallback ( null ) ; } ) . catch ( definedCallback ) ; } else { definedCallback ( null ) ; } }
Closes out this object, releasing any server connections.
Closes out this object releasing any server connections .