NewDecoder creates a JSON-over-websocket decoder for type T, which must be deserializable from JSON.
(conn *websocket.Conn, typ websocket.MessageType, logger slog.Logger)
| 72 | // NewDecoder creates a JSON-over-websocket decoder for type T, which must be deserializable from |
| 73 | // JSON. |
| 74 | func NewDecoder[T any](conn *websocket.Conn, typ websocket.MessageType, logger slog.Logger) *Decoder[T] { |
| 75 | ctx, cancel := context.WithCancel(context.Background()) |
| 76 | return &Decoder[T]{conn: conn, ctx: ctx, cancel: cancel, typ: typ, logger: logger} |
| 77 | } |
no outgoing calls