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

Struct Manager

coderd/notifications/manager.go:41–65  ·  view source on GitHub ↗

Manager manages all notifications being enqueued and dispatched. Manager maintains a notifier: this consumes the queue of notification messages in the store. The notifier dequeues messages from the store _CODER_NOTIFICATIONS_LEASE_COUNT_ at a time and concurrently "dispatches" these messages, mean

Source from the content-addressed store, hash-verified

39// we split notifiers out into separate targets for greater processing throughput; in this case we will need an
40// alternative mechanism for handling backpressure.
41type Manager struct {
42 cfg codersdk.NotificationsConfig
43
44 store Store
45 log slog.Logger
46
47 handlers map[database.NotificationMethod]Handler
48 method database.NotificationMethod
49 helpers template.FuncMap
50
51 metrics *Metrics
52
53 success, failure chan dispatchResult
54
55 mu sync.Mutex // Protects following.
56 closed bool
57 notifier *notifier
58
59 runOnce sync.Once
60 stop chan any
61 done chan any
62
63 // clock is for testing only
64 clock quartz.Clock
65}
66
67type ManagerOption func(*Manager)
68

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected