all method

List<Operation> all({
  1. String? nodeId,
  2. bool runningOnly = false,
})

Every known operation, newest first; optionally only those for nodeId, or only those still running.

Implementation

List<Operation> all({String? nodeId, bool runningOnly = false}) {
  final matches = _operations.values.where(
    (o) =>
        (nodeId == null || o.nodeId == nodeId) &&
        (!runningOnly || o.isRunning),
  );
  return matches.toList()..sort((a, b) => b.startedAt.compareTo(a.startedAt));
}