Executor.ExecuteAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Process an incoming message using the registered handlers.
public System.Threading.Tasks.ValueTask<object?> ExecuteAsync(object message, Microsoft.Agents.AI.Workflows.Checkpointing.TypeId messageType, Microsoft.Agents.AI.Workflows.IWorkflowContext context, System.Threading.CancellationToken cancellationToken = default);
member this.ExecuteAsync : obj * Microsoft.Agents.AI.Workflows.Checkpointing.TypeId * Microsoft.Agents.AI.Workflows.IWorkflowContext * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<obj>
Public Function ExecuteAsync (message As Object, messageType As TypeId, context As IWorkflowContext, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Object)
Parameters
- message
- Object
The message to be processed by the executor.
- messageType
- TypeId
The "declared" type of the message (captured when it was being sent). This is used to enable routing messages as their base types, in absence of true polymorphic type routing.
- context
- IWorkflowContext
The workflow context in which the executor executes.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
A ValueTask representing the asynchronous operation, wrapping the output from the executor.
Exceptions
No handler found for the message type.
An exception is generated while handling the message.