suspendUntil method
Suspends runId until the given when.
Implementations should persist data so it becomes available as
resumeData when the run wakes up.
Implementation
@override
Future<void> suspendUntil(
String runId,
String stepName,
DateTime when, {
Map<String, Object?>? data,
}) async {
final state = _runs[runId];
if (state == null) return;
_runs[runId] = state.copyWith(
status: WorkflowStatus.suspended,
cursor: state.cursor,
resumeAt: when,
suspensionData: _prepareSuspensionData(data, resumeAt: when),
waitTopic: null,
updatedAt: _clock.now(),
);
_due.putIfAbsent(when, () => <String>{}).add(runId);
}