IsStreaming checks if the stream has been initiated, or when events are buffered which - when processed - will initiate the stream. Note: there is a known race between the channel pop in Start and the subsequent InitiateStream call where this can briefly return false for a stream that's about to be
()
| 229 | // code. See https://github.com/coder/aibridge/issues/223 and |
| 230 | // https://github.com/coder/internal/issues/1524. |
| 231 | func (s *EventStream) IsStreaming() bool { |
| 232 | return s.initiated.Load() || len(s.eventsCh) > 0 |
| 233 | } |
| 234 | |
| 235 | // IsConnError checks if an error is related to client disconnection or context cancellation. |
| 236 | func IsConnError(err error) bool { |
no test coverage detected