close method

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

Closes the publisher after draining the queue: every log accepted before closing is processed, including logs published while a batch was in flight. Logs returned to the retry buffer after closing are dropped.

After closing, publish throws a StateError and flush completes immediately. Repeated calls return the same future.

Do not await this (or flush) from inside handle: closing waits for the running batch to complete, so it would deadlock.

Implementation

@override
Future<void> close() {
  _closed = true;

  return super.close();
}