Closed hypnosis01 closed 2 weeks ago
How do I make each process instance execute in a separate thread?
Don't use Thread.Sleep, use Async and Task.Delay and it will work as expected. The problem is Thread.Sleep blocks the thread that enters the workflow execution preventing additional executions from starting.
That being said I think this behavior should not need this to work.
public class AspSample : StepBody { private static readonly Logger log = LogManager.GetCurrentClassLogger(); private static volatile int _counter = 0;
}
var host = serviceProvider.GetService();
host.StartWorkflow("PTWorkFlow", 1, null);
host.StartWorkflow("PTWorkFlow", 1, null);
host.StartWorkflow("PTWorkFlow", 1, null);
host.StartWorkflow("PTWorkFlow", 1, null);
Multiple process implementations were initiated。
Multiple processes are executed serially.......