Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IClosable

Interface for components that require explicit closure.

For components that require opening as well as closing use IOpenable interface instead.

see

IOpenable

see

Closer

Example

class MyConnector implements ICloseable {
    private _client: any = null;

    ... // The _client can be lazy created

    public close(correlationId: string, callback: (err: any) => void): void {
        if (this._client != null) {
            this._client.close();
            this._client = null;
        }
        callback(null);
    }
}

Hierarchy

Implemented by

Index

Methods

Methods

close

  • close(correlationId: string, callback?: function): void
  • Closes component and frees used resources.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • Optional callback: function

      callback function that receives error or null no errors occured.

        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns void

Generated using TypeDoc