recreateOutlet method

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

Recreates the publishing endpoint to reflect a changed Node.

Required because a node's role is part of its published identity, and election changes that role after the endpoint already exists.

Implementation

@override
Future<void> recreateOutlet() async {
  if (_disposed) return;
  // Republish: the node's role is part of its descriptor and election
  // changes it. The hub treats a repeat registration as an update.
  _slot = await connection.announce(descriptor);
  _publishing = true;
}