notifySessions sends the notification n to all existing sessions. It is called asynchronously by changeAndNotify.
(n string)
| 651 | // notifySessions sends the notification n to all existing sessions. |
| 652 | // It is called asynchronously by changeAndNotify. |
| 653 | func (s *Server) notifySessions(n string) { |
| 654 | s.mu.Lock() |
| 655 | sessions := slices.Clone(s.sessions) |
| 656 | s.pendingNotifications[n] = nil |
| 657 | s.mu.Unlock() // Don't hold the lock during notification: it causes deadlock. |
| 658 | notifySessions(sessions, n, changeNotificationParams[n], s.opts.Logger) |
| 659 | } |
| 660 | |
| 661 | // shouldSendListChangedNotification checks if the server's capabilities allow |
| 662 | // sending the given list-changed notification. |
no test coverage detected