-
Notifications
You must be signed in to change notification settings - Fork 2
Workflow hosting
Gurmit Teotia edited this page Jan 14, 2018
·
12 revisions
You can host the workflows using Guflow.Decider.WorkflowHost class. Following example shows how to host TranscodeWorkflow
var domain = //initialized domain
using(var host = domain.Host(new[]{new TranscodeWorkflow()})
{
host.StartExecution();
Console.WriteLine("Press a key to terminate the host");
Console.ReadKey();
}
Hosting concept is very much specific to Guflow and not to Amazon SWF. When you start the workflow host it goes in execution loop and it executes following steps:
- Poll for new decision tasks on Amazon SWF
- Execute the returned decisions tasks against correct workflow
- Send the workflow response back to Amazon SWF
In above example WorkflowHosts will poll for new decisions task on "DefaultTaskList" which is provided on WorkflowDescriptionAttribute, however you can specify the different task list to poll on by using other overload method:
var domain = //initialized domain
using(var host = domain.Host(new []{new TranscodeWorkflow()})
{
host.StartExecution(new TaskQueue("some-queuename"));
Console.WriteLine("Press a key to terminate the host");
Console.ReadKey();
}
Please look at error handling section on handling the hosted related exceptions.
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