FutureClose<T> extension

An extension on the Future class that allows you to manage its lifecycle with a HasCloser's Closer. This extension simplifies the process of adding a Future to a Closer while hiding the SingleAutoClosable implementation details.

on

Methods

closeWith(HasCloser hasCloser, {void onClose()?}) Future<T>

Available on Future<T>, provided by the FutureClose extension

Associates the Future with the Closer context. You can provide an optional onClose callback function to define custom actions to be performed when the Future is closed.