waitSignal<T> method

  1. @override
Future<T?> waitSignal<T>(
  1. String signalName, {
  2. Duration? timeout,
})
override

Suspends the workflow until an external signal is received.

  • signalName: The name of the signal to wait for.
  • timeout: Optional maximum wait time before expiring.

Returns the signal payload, or null if timed out.

Implementation

@override
Future<T?> waitSignal<T>(
  String signalName, {
  Duration? timeout,
}) async {
  validateIdentifier(signalName, 'signalName');
  final result = await _signalManager.waitForSignal(
    workflowExecutionId: _workflowExecutionId,
    signalName: signalName,
    timeout: timeout,
  );
  return result as T?;
}