markCompleted method

  1. @override
Future<void> markCompleted(
  1. String runId,
  2. Object? result
)
override

Marks a run as completed and stores the final result.

Implementation

@override
/// Marks a run as completed and stores the final result.
Future<void> markCompleted(String runId, Object? result) async {
  final state = _runs[runId];
  if (state == null) return;
  _removeWatcherForRun(runId);
  _runs[runId] = state.copyWith(
    status: WorkflowStatus.completed,
    result: result,
    resumeAt: null,
    waitTopic: null,
    suspensionData: const <String, Object?>{},
    ownerId: null,
    leaseExpiresAt: null,
    updatedAt: _clock.now(),
  );
}