$callSave static method

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

Implementation

static Future<void> $callSave(
    Node node, NodeStorage storage, PrecisionStopwatch wallClock) async {
  if (node is Stateful) {
    Stateful s = node as Stateful;
    s._storage = storage;
    PrecisionStopwatch p = PrecisionStopwatch.start();
    await storage.write(s, await s.onSave());
    node.logger.verbose(
        "Saved State in ${p.getMilliseconds().toStringAsFixed(0)}ms");
  }
}