mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
chore: rename client Listen to ConnectRPC (#11916)
ConnectRPC seems more appropriate for this function
This commit is contained in:
@ -171,9 +171,8 @@ func (c *Client) RewriteDERPMap(derpMap *tailcfg.DERPMap) {
|
||||
}
|
||||
}
|
||||
|
||||
// Listen connects to the workspace agent API WebSocket
|
||||
// that handles connection negotiation.
|
||||
func (c *Client) Listen(ctx context.Context) (drpc.Conn, error) {
|
||||
// ConnectRPC connects to the workspace agent API and tailnet API
|
||||
func (c *Client) ConnectRPC(ctx context.Context) (drpc.Conn, error) {
|
||||
rpcURL, err := c.SDK.URL.Parse("/api/v2/workspaceagents/me/rpc")
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("parse url: %w", err)
|
||||
@ -210,7 +209,7 @@ func (c *Client) Listen(ctx context.Context) (drpc.Conn, error) {
|
||||
netConn := &closeNetConn{
|
||||
Conn: wsNetConn,
|
||||
closeFunc: func() {
|
||||
_ = conn.Close(websocket.StatusGoingAway, "Listen closed")
|
||||
_ = conn.Close(websocket.StatusGoingAway, "ConnectRPC closed")
|
||||
},
|
||||
}
|
||||
config := yamux.DefaultConfig()
|
||||
|
Reference in New Issue
Block a user