Repository navigation
Throttling activity
Guflow allows you control the number of activity tasks executing concurrently in a host. By default ActivititesHost executes the activity tasks concurrently equal to the number of processor's core. You can change the activity concurrency level as shown below:
using(var host = domain.Host(new []{typeof(Activity1)}))
{
//Below code will allow 10 activity tasks to be executed concurrently on this host.
host.Execution = ActivityExecution.Concurrent(10);
host.StartExecution()
Console.WriteLine("Press any key to terminate");
Console.ReadKey();
} The number of threads used to execute activity tasks concurrently depends on how you are writing the activity execute method. For synchronous activity method one thread will be used to execute a activity task which means in above example 10 threads will be used to execute 10 activity tasks. However if the activity execution method is async then number of threads used to execute 10 activity task concurrently will be lower.
You can also configure the ActivityHost to execute only one activity task at a time as show below:
```cs
using(var host = domain.Host(new []{typeof(Activity1)}))
{
//Following code will configure the host to execute the activity task in
host.Execution = ActivityExecution.Sequential;
host.StartExecution();
Console.WriteLine("Press any key to terminate");
Console.ReadKey();
} Guflow
- Prerequisite
- Installation
-
Workflows
- Creating first workflow
- Registration
- Hosting
- Start workflow
- Schedule activities
- Schedule timers
- Schedule lambda function
- Schedule child workflows
- Lambda functions vs activities
- Workflow input
- Workflow actions
- Signals
- Workflow branches
- Deflow algorithm
- Workflow events
- Query APIs
- Custom polling strategy
- Things to take care of
- Activites
- Unit testing
- Performance & scalability
- Error handling
- Logging
- Debugging
- Tutorial
- Release notes