SingleAutoClosable<T> constructor

SingleAutoClosable<T>(
  1. T closable,
  2. void onClose()?
)

Creates an SingleAutoClosable instance to manage the termination and cleanup of a specified closable entity.

The closable parameter represents the entity that should be closed when necessary, such as a stream subscription or a resource. The onClose parameter is an optional callback function that can be used to define custom actions to be performed when the closable entity is closed.

Implementation

SingleAutoClosable(this.closable, this.onClose);