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

Function New

coderd/workspaceconnwatcher/watcher.go:42–56  ·  view source on GitHub ↗
(ctx context.Context, logger slog.Logger, sub pubsub.Subscriber, db database.Store)

Source from the content-addressed store, hash-verified

40}
41
42func New(ctx context.Context, logger slog.Logger, sub pubsub.Subscriber, db database.Store) *Watcher {
43 ctx, cancel := context.WithCancel(ctx)
44 w := &Watcher{
45 logger: logger.Named("wsconnwatcher"),
46 ctx: ctx,
47 cancel: cancel,
48 sub: sub,
49 db: db,
50 }
51 go func() {
52 <-ctx.Done()
53 w.Close()
54 }()
55 return w
56}
57
58// @Summary Workspace Agent Connection Watch
59// @ID workspace-agent-connection-watch

Callers 2

NewFunction · 0.92
newHarnessFunction · 0.92

Calls 3

CloseMethod · 0.95
NamedMethod · 0.80
DoneMethod · 0.45

Tested by 1

newHarnessFunction · 0.74