terminate method

  1. @override
Future<void> terminate()
override

Tears the executor down; safe to call more than once.

Implementation

@override
Future<void> terminate() async {
  terminateCount += 1;
  if (_terminated) {
    return;
  }
  _terminated = true;
  _bufferedJobs.clear();
  // Not awaited: close()'s future only completes once a listener has
  // received the done event, which never happens for a never-listened
  // stream.
  unawaited(_messages.close());
}