broadcastUpdatesLocked sends the current state to any listening clients. This method assumes that api.mu is held.
()
| 747 | // broadcastUpdatesLocked sends the current state to any listening clients. |
| 748 | // This method assumes that api.mu is held. |
| 749 | func (api *API) broadcastUpdatesLocked() { |
| 750 | // Broadcast state changes to WebSocket listeners. |
| 751 | for _, ch := range api.updateChans { |
| 752 | select { |
| 753 | case ch <- struct{}{}: |
| 754 | default: |
| 755 | } |
| 756 | } |
| 757 | } |
| 758 | |
| 759 | func (api *API) watchContainers(rw http.ResponseWriter, r *http.Request) { |
| 760 | ctx := r.Context() |
no outgoing calls
no test coverage detected