MCPcopy Create free account
hub / github.com/coder/coder / Update

Method Update

vpn/tunnel.go:366–382  ·  view source on GitHub ↗

Update pushes a workspace update to the manager

(update tailnet.WorkspaceUpdate)

Source from the content-addressed store, hash-verified

364
365// Update pushes a workspace update to the manager
366func (u *updater) Update(update tailnet.WorkspaceUpdate) error {
367 u.mu.Lock()
368 defer u.mu.Unlock()
369
370 peerUpdate := u.createPeerUpdateLocked(update)
371 msg := &TunnelMessage{
372 Msg: &TunnelMessage_PeerUpdate{
373 PeerUpdate: peerUpdate,
374 },
375 }
376 select {
377 case <-u.ctx.Done():
378 return u.ctx.Err()
379 case u.uSendCh <- msg:
380 }
381 return nil
382}
383
384// sendUpdateResponse responds to the provided `ManagerMessage_GetPeerUpdate` request
385// with the current state of the workspaces.

Callers

nothing calls this directly

Calls 5

ErrMethod · 0.80
LockMethod · 0.45
UnlockMethod · 0.45
DoneMethod · 0.45

Tested by

no test coverage detected