closeCopy method

Future<Consumer> closeCopy()

Closes the Consumer and return new Instance of same Consumer.

Implementation

Future<Consumer> closeCopy() async {
  if (closed) return this;

  _logger.debug('closeCopy()');

  // closed = true;
  await _destroyTrack();
  emit('@close');
  // Emit observer event.
  observer.safeEmit('close');

  return copyWith(closed: true);
}