Open schickling opened 2 years ago
Here's an alternative:
https://github.com/temporalio/samples-typescript/tree/main/activities-sticky-queues
If anyone has a use case in which this doesn't work well, please post a comment, thanks!
Note that the main difference between sticky activities and sessions is concurrency control, max concurrent sessions vs to max concurrent activities per worker.
I took a look at the sticky queue but it's not clear that it matches exactly what I need. In particular, I have two doubts/questions:
Sorry for the late response.
- I want the worker to be able to listen on multiple queues. The workflow should only be coupled to a particular worker after it has picked up the first task.
A worker only listens on a single task queue but you can start multiple workers in the same process. Coupling the workflow to a worker is shown in the sample posted above.
- If the worker crashes midway through execution, how do I ensure the next worker that spawns for that workflow will start over from the beginning?
You'll need to use schedule to start timeout to detect that the worker went away and restart the sequence of activities. This is all part of the sticky activity queues sample.
Would be great if Sessions similar to the Go SDK were supported in TS as well.