MCPcopy Index your code
hub / github.com/coder/coder / NewStream

Function NewStream

codersdk/wsjson/stream.go:15–22  ·  view source on GitHub ↗
(conn *websocket.Conn, readType, writeType websocket.MessageType, logger slog.Logger)

Source from the content-addressed store, hash-verified

13}
14
15func NewStream[R any, W any](conn *websocket.Conn, readType, writeType websocket.MessageType, logger slog.Logger) *Stream[R, W] {
16 return &Stream[R, W]{
17 conn: conn,
18 r: NewDecoder[R](conn, readType, logger),
19 // We intentionally don't call `NewEncoder` because it calls `CloseRead`.
20 w: &Encoder[W]{conn: conn, typ: writeType},
21 }
22}
23
24// Chan returns a `chan` that you can read incoming messages from. The returned
25// `chan` will be closed when the WebSocket connection is closed. If there is an

Callers 9

TestWatchChatGitFunction · 0.92
watchChatGitMethod · 0.92
WatchGitMethod · 0.92
handleWatchMethod · 0.92
dialGitWatchFunction · 0.92

Calls

no outgoing calls

Tested by 4

TestWatchChatGitFunction · 0.74
dialGitWatchFunction · 0.74