$callStop static method

Future<void> $callStop(
  1. Node node,
  2. NodeStorage storage,
  3. PrecisionStopwatch wallClock
)

Implementation

static Future<void> $callStop(
    Node node, NodeStorage storage, PrecisionStopwatch wallClock) async {
  if (node is Lifecycle) {
    if (!(node as Lifecycle).$isRunning) {
      node.logger
          .warn("Node is already stopped? Call stop was called twice?");
    }

    PrecisionStopwatch p = PrecisionStopwatch.start();
    await (node as Lifecycle).onStop();
    node.$metadata["lifecycle.running"] = false;
    node.logger
        .info("Stopped in ${p.getMilliseconds().toStringAsFixed(0)}ms");
  }
}