stop method

  1. @override
void stop()
override

Stops the router.

This method stops the router and cleans up any resources that are being used. It also completes any pending acknowledgements with an error to signal that the router is no longer running.

Implementation

@override
void stop() {
  // Complete any pending acknowledgements with an error to indicate that
  // the router is stopping.
  for (final c in _ackCompleters.values) {
    c.completeError(const ExceptionIsNotRunning());
  }

  // Clear the map of acknowledgement completers to release resources.
  _ackCompleters.clear();

  // Call the superclass's stop method to perform any necessary cleanup.
  super.stop();
}