Web: add some technical details to the socketIO documentation
Add technical details to explain which part of the SocketIO-based broadcast system is implemented where in the source code.
This commit is contained in:
parent
520102627d
commit
b83b929e01
@ -16,7 +16,31 @@ SocketIO messages have an *event name* and *room name*.
|
||||
- **Manager** typically sends to all clients in a specific *room*. Which client
|
||||
has joined which room is determined by the Manager as well. By default every
|
||||
client joins the "job updates" and "chat" rooms. This is done in the
|
||||
`OnConnection` handler defined in `registerSIOEventHandlers()`.
|
||||
`OnConnection` handler defined in `registerSIOEventHandlers()`. Clients can
|
||||
send messages to the Manager to change which rooms they are in.
|
||||
- Received messages (regardless of by whom) are handled based only on their
|
||||
*event name*. The *room name* only determines *which* client receives those
|
||||
*event name*. The *room name* only determines *which client* receives those
|
||||
messages.
|
||||
|
||||
## Technical Details
|
||||
|
||||
The following files & directories are relevant to the SocketIO broadcasting
|
||||
system on the Manager/backend side:
|
||||
|
||||
`internal/manager/webupdates`
|
||||
: package for the SocketIO broadcasting system
|
||||
|
||||
`internal/manager/webupdates/sio_rooms.go`
|
||||
: contains the list of predefined SocketIO *rooms* and *event types*. Note that
|
||||
there are more rooms than listed in that file; there are dynamic room name
|
||||
like `job-fa48930a-105c-4125-a7f7-0aa1651dcd57` that cannot be listed there as
|
||||
constants.
|
||||
|
||||
`internal/manager/webupdates/job_updates.go`
|
||||
: sending job-related updates.
|
||||
|
||||
`internal/manager/webupdates/worker_updates.go`
|
||||
: sending worker-related updates.
|
||||
|
||||
For a relatively simple example of a job update broadcast, see
|
||||
`func (f *Flamenco) SetJobPriority(...)` in `internal/manager/api_impl/jobs.go`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user