add session ID handling to worker communication protocol; allow backend to associate session IDs with subscriptions
Some checks failed
Build Backend Application and Docker Image / build-docker (push) Has been cancelled

This commit is contained in:
Siwat Sirichai 2025-07-14 10:49:59 +07:00
parent 3c67fa933c
commit 8f32de1510

View file

@ -255,6 +255,27 @@ Backend's response to a `patchSession` message.
}
```
### 5.5. Set Session ID
Allows the backend to instruct the worker to associate a session ID with a subscription. This is useful for linking detection events to a specific session.
- **Type:** `setSessionId`
**Payload:**
```json
{
"type": "setSessionId",
"payload": {
"subscriptionIdentifier": "display-001;cam-002",
"sessionId": 12345
}
}
```
> **Note:**
> - The worker should store the session ID for the given subscription and use it in subsequent detection or patch messages as appropriate.
## 6. Example Communication Log
This section shows a typical sequence of messages between the backend and the worker. Patch messages are not included, as they are only used when the worker cannot keep up.