kick wakes the long-poll handler currently serving owner so it drains pending TX frames immediately. A non-blocking send keeps repeated kicks from blocking the upstream-read goroutine when the owner is not currently polling — the buffered len-1 channel collapses bursts into a single wake.
(owner [frame.ClientIDLen]byte)
| 889 | // from blocking the upstream-read goroutine when the owner is not currently |
| 890 | // polling — the buffered len-1 channel collapses bursts into a single wake. |
| 891 | func (s *Server) kick(owner [frame.ClientIDLen]byte) { |
| 892 | ch := s.activityFor(owner) |
| 893 | select { |
| 894 | case ch <- struct{}{}: |
| 895 | default: |
| 896 | } |
| 897 | } |
| 898 | |
| 899 | // activityFor returns owner's wake channel, lazily allocating it on first |
| 900 | // use. Channels are kept for the life of the server; with a small number of |
no test coverage detected