Chan returns a `chan` that you can read incoming messages from. The returned `chan` will be closed when the WebSocket connection is closed. If there is an error reading from the WebSocket or decoding a value the WebSocket will be closed. Safety: Chan must only be called once. Successive calls will
()
| 28 | // |
| 29 | // Safety: Chan must only be called once. Successive calls will panic. |
| 30 | func (s *Stream[R, W]) Chan() <-chan R { |
| 31 | return s.r.Chan() |
| 32 | } |
| 33 | |
| 34 | func (s *Stream[R, W]) Send(v W) error { |
| 35 | return s.w.Encode(v) |
no outgoing calls