Notify sends a signal to all subscribers of the given chat IDs without adding any paths. Zero-value UUIDs are silently skipped.
(chatIDs []uuid.UUID)
| 55 | // Notify sends a signal to all subscribers of the given chat IDs |
| 56 | // without adding any paths. Zero-value UUIDs are silently skipped. |
| 57 | func (ps *PathStore) Notify(chatIDs []uuid.UUID) { |
| 58 | affected := make([]uuid.UUID, 0, len(chatIDs)) |
| 59 | for _, id := range chatIDs { |
| 60 | if id != uuid.Nil { |
| 61 | affected = append(affected, id) |
| 62 | } |
| 63 | } |
| 64 | if len(affected) == 0 { |
| 65 | return |
| 66 | } |
| 67 | ps.notifySubscribers(affected) |
| 68 | } |
| 69 | |
| 70 | // notifySubscribers sends a non-blocking signal to all subscriber |
| 71 | // channels for the given chat IDs. |