close static method

Future close(
  1. IContext? context,
  2. List? components
)

Closes multiple components.

To be closed components must implement ICloseable interface. If they don't the call to this method has no effect.

  • context (optional) a context to trace execution through call chain.
  • components the list of components that are to be closed. Returns Future that receives error or null no errors occured.

See closeOne See IClosable

Implementation

static Future close(IContext? context, List? components) async {
  if (components == null) return;

  for (var component in components) {
    await Closer.closeOne(context, component);
  }
}