Share via


IDurableOrchestrationContext.WaitForExternalEvent Method

Definition

Overloads

WaitForExternalEvent(String)

Waits asynchronously for an event to be raised with name name.

WaitForExternalEvent(String, TimeSpan, CancellationToken)

Waits asynchronously for an event to be raised with name name.

WaitForExternalEvent<T>(String, TimeSpan, CancellationToken)

Waits asynchronously for an event to be raised with name name and returns the event data.

WaitForExternalEvent<T>(String)

Waits asynchronously for an event to be raised with name name and returns the event data.

WaitForExternalEvent<T>(String, TimeSpan, T, CancellationToken)

Waits asynchronously for an event to be raised with name name and returns the event data.

WaitForExternalEvent(String)

Source:
IDurableOrchestrationContext.cs

Waits asynchronously for an event to be raised with name name.

public System.Threading.Tasks.Task WaitForExternalEvent (string name);
abstract member WaitForExternalEvent : string -> System.Threading.Tasks.Task
Public Function WaitForExternalEvent (name As String) As Task

Parameters

name
String

The name of the event to wait for.

Returns

A durable task that completes when the external event is received.

Remarks

External clients can raise events to a waiting orchestration instance using RaiseEventAsync(String, String, Object) with the object parameter set to null.

Applies to

WaitForExternalEvent(String, TimeSpan, CancellationToken)

Source:
IDurableOrchestrationContext.cs

Waits asynchronously for an event to be raised with name name.

public System.Threading.Tasks.Task WaitForExternalEvent (string name, TimeSpan timeout, System.Threading.CancellationToken cancelToken = default);
abstract member WaitForExternalEvent : string * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function WaitForExternalEvent (name As String, timeout As TimeSpan, Optional cancelToken As CancellationToken = Nothing) As Task

Parameters

name
String

The name of the event to wait for.

timeout
TimeSpan

The duration after which to throw a TimeoutException.

cancelToken
CancellationToken

The CancellationToken to use for cancelling timeout's internal timer.

Returns

A durable task that completes when the external event is received.

Exceptions

The external event was not received before the timeout expired.

Remarks

External clients can raise events to a waiting orchestration instance using RaiseEventAsync(String, String, Object) with the object parameter set to null.

Applies to

WaitForExternalEvent<T>(String, TimeSpan, CancellationToken)

Source:
IDurableOrchestrationContext.cs

Waits asynchronously for an event to be raised with name name and returns the event data.

public System.Threading.Tasks.Task<T> WaitForExternalEvent<T> (string name, TimeSpan timeout, System.Threading.CancellationToken cancelToken = default);
abstract member WaitForExternalEvent : string * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
Public Function WaitForExternalEvent(Of T) (name As String, timeout As TimeSpan, Optional cancelToken As CancellationToken = Nothing) As Task(Of T)

Type Parameters

T

Any serializeable type that represents the JSON event payload.

Parameters

name
String

The name of the event to wait for.

timeout
TimeSpan

The duration of time to wait for the event.

cancelToken
CancellationToken

The CancellationToken to use for cancelling timeout's internal timer.

Returns

Task<T>

A durable task that completes when the external event is received, or throws a timeout exception"/> if the timeout expires.

Exceptions

The external event was not received before the timeout expired.

Remarks

External clients can raise events to a waiting orchestration instance using RaiseEventAsync(String, String, Object).

Applies to

WaitForExternalEvent<T>(String)

Source:
IDurableOrchestrationContext.cs

Waits asynchronously for an event to be raised with name name and returns the event data.

public System.Threading.Tasks.Task<T> WaitForExternalEvent<T> (string name);
abstract member WaitForExternalEvent : string -> System.Threading.Tasks.Task<'T>
Public Function WaitForExternalEvent(Of T) (name As String) As Task(Of T)

Type Parameters

T

Any serializeable type that represents the JSON event payload.

Parameters

name
String

The name of the event to wait for.

Returns

Task<T>

A durable task that completes when the external event is received.

Remarks

External clients can raise events to a waiting orchestration instance using RaiseEventAsync(String, String, Object).

Applies to

WaitForExternalEvent<T>(String, TimeSpan, T, CancellationToken)

Source:
IDurableOrchestrationContext.cs

Waits asynchronously for an event to be raised with name name and returns the event data.

public System.Threading.Tasks.Task<T> WaitForExternalEvent<T> (string name, TimeSpan timeout, T defaultValue, System.Threading.CancellationToken cancelToken = default);
abstract member WaitForExternalEvent : string * TimeSpan * 'T * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
Public Function WaitForExternalEvent(Of T) (name As String, timeout As TimeSpan, defaultValue As T, Optional cancelToken As CancellationToken = Nothing) As Task(Of T)

Type Parameters

T

Any serializeable type that represents the JSON event payload.

Parameters

name
String

The name of the event to wait for.

timeout
TimeSpan

The duration of time to wait for the event.

defaultValue
T

If specified, the default value to return if the timeout expires before the external event is received. Otherwise, a timeout exception will be thrown instead.

cancelToken
CancellationToken

The CancellationToken to use for cancelling timeout's internal timer.

Returns

Task<T>

A durable task that completes when the external event is received, or returns the value of defaultValue if the timeout expires.

Remarks

External clients can raise events to a waiting orchestration instance using RaiseEventAsync(String, String, Object).

Applies to