close method

  1. @override
Future close(
  1. String? correlationId
)

Closes component and frees used resources.

  • correlationId (optional) transaction id to trace execution through call chain. Return Future that receives null no errors occured. throws error

Implementation

@override
Future close(String? correlationId) async {
  if (!_opened) {
    return null;
  }

  if (endpoint == null) {
    throw InvalidStateException(
        correlationId, 'NOendpoint', 'HTTP endpoint is missing');
  }

  if (_localEndpoint) {
    await endpoint!.close(correlationId);
  }
  _opened = false;
  return null;
}