I have an frontend where is connected to an exclusive service that is an websocket server. This server just listen for redis pub/sub events and publish to your clients via websocket events.
Scenario
- A realtime application sends a signal (event) to an long running workflow (hundred of signals per second).
- A workflow child is created for each signal according to signal type received
- Executing this child workflow, the temporal worker access redis, get a specific key, make some calcs, and update redis key value (this step is necessary because each pod has its own metric, and the system metric is the result of sum, subtraction, score, etc depending of metric. Ex: pod 1 has 1 call, pod 2 has 2 calls, so the system calls are 3.)
- Temporal worker publish to Redis pub/sub the new value.
- Websocket server listen the Redis pub/sub and publish to your clients.
- Frontend receive the websocket event and update the state of item
Problems
- We’ve experienced delays (30s for example) in events depending on Temporal load, and worker availability (sometimes the schedule-to-start time is a little bit more longer than required)
- When some calc is not made correctly, the screen “freeze” because worker is trying to execute activity again