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 (client != null) {
    // Eat exceptions
    try {
      client!.close();
      logger.debug(correlationId, 'Closed REST service at %s', [uri]);
    } catch (ex) {
      logger
          .warn(correlationId, 'Failed while closing REST service: %s', [ex]);
    }

    client = null;
    uri = null;
  }
}