A Task Queue is a lightweight, dynamically allocated queue that one or more Worker Entities poll for Tasks
Say you create a parent workflow that spawns millions of child workflows, each with 3 activities. The worker.go file would look something like this using the Go SDK:
func main() {
c, err := client.Dial(client.Options{})
if err != nil {
log.Fatalln("Unable to create client", err)
}
defer c.Close()
w := worker.New(c, app.MyTaskQueue, worker.Options{})
w.RegisterWorkflow(ParentWorkflow)
w.RegisterWorkflow(ChildWorkflow)
w.RegisterActivity(Activity1)
w.RegisterActivity(Activity2)
w.RegisterActivity(Activity3)
err = w.Run(worker.InterruptCh())
if err != nil {
log.Fatal("Unable to start worker", err)
}
}
So here, you have to create a worker with a specified Task Queue. Going back to my question, which was derived from my assumption that having multiple Task Queues can help execute tasks faster, is it possible for a Worker Entity to allocate Tasks to multiple task queues?
Going back to my question, which was derived from my assumption that having multiple task queues can help execute tasks faster, is it possible for a Worker Entity to allocate Tasks to multiple task queues?
Your assumption is not correct. A single task queue can scale as high as needed.
The revised question is can I have a workflow which spans activities that are bound to different task queues?
On my analysis of task queues, there are two things that I need to consider, the first is prioritization, especially since temporal task queues have no guarantee of ordering and the second is whether we will have all our workers be the same, or if we will dedicate some to specific tasks especially since worker entities listening to the same task queue must be registered to handle the exact same WF Types and Activity Types.
I got a bit confused by your answer. Let me make sure to check. Is it possible for a workflow to specify multiple task queues through ActivityOptions when scheduling activities?
Can I have a workflow with 3 activities that are bound to 3 workers like activityA that is bound to workerA and allocated to a task queueA, activityB that is bound to workerB and allocated to a task queueB, activityC that is bound to workerC and allocated to a task queueC,