Red connections are through ZeroMQ sockets, Blue are through WebSockets and Green are through HTTP. All ZeroMQ messages are sent as multipart with one string (command, option) per part, with no empty frames (unles explicitly specified otherwise).
- **progress** - notice about evaluation progress. Requires 2 or 4 arguments:
-`job_id` - identifier of current job
-`state` - what is happening now. One of "DOWNLOADED" (submission successfuly fetched), "UPLOADED" (results are uploaded to fileserver), "STARTED" (evaluation started), "ENDED" (evaluation is finnished) and "TASK" (task state changed - see below)
-`task_id` - only present for "TASK" state - identifier of task in current job
-`task_state` - only present for "TASK" state - result of task evaluation. One of "COMPLETED" and "FAILED".
Broker is server when comminicating with worker. IP address and port are configurable, protocol is TCP. Worker socket is DEALER, broker one is ROUTER type. Because of that, very first part of every (multipart) message from broker to worker must be target worker's socket identity (which is saved on it's **init** command).
-`header` - additional header describing worker capabilities. Format must be `header_name=value`, every header shall be in a separate message frame. There is no maximum limit on number of headers.
- **done** - job evaluation finished, see **done** command in [[Communication#main-communication]].
- **progress** - evaluation progress report, see **progress** command in [[Communication#progress-callback]]
-`header` - additional header describing worker capabilities. Format must be `header_name=value`, every header shall be in a separate message frame. There is no maximum limit on number of headers. There may be also no headers at all.
Monitor interacts with browser through WebSocket connection. Monitor acts as server and browsers are connecting to it. IP address and port are also configurable. When client connects to the monitor, it sends a message with string representation of channel id (which messages are interested in, usually id of evaluating job). There can be at most one listener per channel, latter connection replaces previous one. After establishing the connection, the message "Connection established" is sent from monitor to browser.
When monitor receives "progress" message from broker there are two options:
- there is no WebSocket connection for listed channel (job id) - message is dropped
- there is active WebSocket connection for listed channel - message is parsed into JSON format (see below) and send as string to browser. Messages for active connections are queued, so no messages are discarded even on heavy workload.
Message JSON format is dictionary with keys:
- **command** - type of progress. One of "STARTED" (evaluation started), "DOWNLOADED" (submission source downloaded), "TASK" (progress on one of the tasks), "UPLOADED" (results are uploaded), "ENDED" (evaluation ended)
- **task_id** - id of currently evaluated task. Present only if **command** is "TASK".