setError sets the error state thread-safely
(err error)
| 236 | |
| 237 | // setError sets the error state thread-safely |
| 238 | func (h *SSEHandlerCh) setError(err error) { |
| 239 | h.lock.Lock() |
| 240 | defer h.lock.Unlock() |
| 241 | |
| 242 | if h.err == nil { |
| 243 | h.err = err |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | // queueMessage queues an SSEMessage to be written |
| 248 | func (h *SSEHandlerCh) queueMessage(msg SSEMessage) error { |