dispose method

  1. @mustCallSuper
void dispose()
inherited

Disposes this ChopperClient to clean up memory.

Warning: If a custom http.Client was provided while creating this ChopperClient, this method will not close it. In that case, closing the client is its creator's responsibility.

Implementation

@mustCallSuper
void dispose() {
  _requestController.close();
  _responseController.close();
  _services.clear();

  if (_clientIsInternal) {
    httpClient.close();
  }
}