()
| 5 | ) |
| 6 | |
| 7 | func (s *Scaler) routineScaleUp() { |
| 8 | messages, err := s.pubsubClient.Subscribe(context.Background(), "scale-up") |
| 9 | if err != nil { |
| 10 | panic(err) |
| 11 | } |
| 12 | |
| 13 | for msg := range messages { |
| 14 | // Notify if the stream is present internally |
| 15 | s.lock.RLock() |
| 16 | if isActive, p := s.isActiveStreams[msg.Payload]; p { |
| 17 | isActive.Notify() |
| 18 | } |
| 19 | s.lock.RUnlock() |
| 20 | } |
| 21 | } |