Pip-Services-Commons-Dotnet
Public Member Functions | List of all members
PipServices3.Commons.Run.IClosable Interface Reference

Interface for components that require explicit closure. More...

Inheritance diagram for PipServices3.Commons.Run.IClosable:
PipServices3.Commons.Run.IOpenable

Public Member Functions

Task CloseAsync (string correlationId)
 Closes component and frees used resources. More...
 

Detailed Description

Interface for components that require explicit closure.

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

class MyConnector: IClosable
{
private object _client = null;
... // The _client can be lazy created
public void Close(string correlationId)
{
if (this._client != null)
{
this._client.Close();
this._client = null;
}
}
}

See IOpenable, Closer

Member Function Documentation

◆ CloseAsync()

Task PipServices3.Commons.Run.IClosable.CloseAsync ( string  correlationId)

Closes component and frees used resources.

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

The documentation for this interface was generated from the following file: