Skip to content
Discussion options

You must be logged in to vote

Assuming that your executors are stateless, singletons are probably a good way of managing them. For "pure" function executors (input => output, no side-effects), this is almost certainly the case.

Once you start thinking about state it becomes a little more complicated and depends a little on what concurrency mode you intend to use when executing the workflow. To allow developers to begin quickly with minimal boilerplate, we allow them to pass Executor instances directly to the WorkflowBuilder. If those instances contain state on the object, however, it could cause bad behaviour if used simultaneously from multiple threads or multiple concurrent runs.

To protect against this, we introduc…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Marcus-Kanon
Comment options

Answer selected by Marcus-Kanon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
.NET workflows Related to Workflows in agent-framework
2 participants