StatefulExecutor<TState,TInput> Constructor
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.
Provides a simple executor implementation that uses a single message handler function to process incoming messages, and maintain state across invocations.
protected StatefulExecutor(string id, Func<TState> initialStateFactory, Microsoft.Agents.AI.Workflows.StatefulExecutorOptions? options = default, System.Collections.Generic.IEnumerable<Type>? sentMessageTypes = default, System.Collections.Generic.IEnumerable<Type>? outputTypes = default, bool declareCrossRunShareable = false);
new Microsoft.Agents.AI.Workflows.StatefulExecutor<'State, 'Input> : string * Func<'State> * Microsoft.Agents.AI.Workflows.StatefulExecutorOptions * seq<Type> * seq<Type> * bool -> Microsoft.Agents.AI.Workflows.StatefulExecutor<'State, 'Input>
Protected Sub New (id As String, initialStateFactory As Func(Of TState), Optional options As StatefulExecutorOptions = Nothing, Optional sentMessageTypes As IEnumerable(Of Type) = Nothing, Optional outputTypes As IEnumerable(Of Type) = Nothing, Optional declareCrossRunShareable As Boolean = false)
Parameters
- id
- String
A unique identifier for the executor.
- initialStateFactory
- Func<TState>
A factory to initialize the state value to be used by the executor.
- options
- StatefulExecutorOptions
Configuration options for the executor. If null, default options will be used.
- sentMessageTypes
- IEnumerable<Type>
Message types sent by the handler. Defaults to empty, and will filter out non-matching messages.
- outputTypes
- IEnumerable<Type>
Message types yielded as output by the handler. Defaults to empty.
- declareCrossRunShareable
- Boolean
Declare that this executor may be used simultaneously by multiple runs safely.