You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TaskOrchestration wires together individual tasks into a workflow. Here is how you define the tasks:
public class EncodeActivity : TaskActivity<string, string>
{
protected override string Execute(TaskContext context, string input)
{
Console.WriteLine("Encoding video " + input);
// TODO : actually encode the video to a destination
return "http://<azurebloblocation>/encoded_video.avi";
}
}
public class EmailActivity : TaskActivity<string, object>
{
protected override object Execute(TaskContext context, string input)
{
// TODO : actually send email to user
return null;
}
}
Pretty straight forward, right? Then you create a worker in Program.cs and register all the tasks and orchestrations:
DTF handles all the magic in the background and can use different storage solutions such as service bus or even mssql.
How would you implement DTF in this clean architecture template?
The use cases reside in the application layer. We trigger commands using mediatr in the UI layer. How would you incorporate DTF here? Obviously we can create an abstraction of TaskHubClient in the application layer and use it to trigger orchestrations. But how would you organize commands, tasks and orchestrations? I was thinking, that tasks are actually no different from commands.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was playing around with the durable task framework. DTF allows you to run workflows/orchestrations in the background. Here is an example:
The TaskOrchestration wires together individual tasks into a workflow. Here is how you define the tasks:
Pretty straight forward, right? Then you create a worker in Program.cs and register all the tasks and orchestrations:
Using the DTF client you can actually trigger an orchestration:
DTF handles all the magic in the background and can use different storage solutions such as service bus or even mssql.
How would you implement DTF in this clean architecture template?
The use cases reside in the application layer. We trigger commands using mediatr in the UI layer. How would you incorporate DTF here? Obviously we can create an abstraction of TaskHubClient in the application layer and use it to trigger orchestrations. But how would you organize commands, tasks and orchestrations? I was thinking, that tasks are actually no different from commands.
Beta Was this translation helpful? Give feedback.
All reactions