MCPcopy
hub / github.com/spacecloud-io/space-cloud / routineScaleUp

Method routineScaleUp

runner/modules/scaler/routine.go:7–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5)
6
7func (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}

Callers 1

StartMethod · 0.95

Calls 2

SubscribeMethod · 0.65
NotifyMethod · 0.45

Tested by

no test coverage detected