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

Method removeIsActiveStream

runner/modules/scaler/helpers.go:58–72  ·  view source on GitHub ↗
(project, service, version string)

Source from the content-addressed store, hash-verified

56}
57
58func (s *Scaler) removeIsActiveStream(project, service, version string) {
59 s.lock.Lock()
60 defer s.lock.Unlock()
61
62 // Generate a key for the stream
63 key := generateKey(project, service, version)
64
65 // Close the stream if it already existed
66 if stream, p := s.isActiveStreams[key]; p {
67 close(stream.ch)
68 }
69
70 // Remove the stream from the map
71 delete(s.isActiveStreams, key)
72}
73
74func generateKey(project, service, version string) string {
75 return fmt.Sprintf("%s---%s---%s", project, service, version)

Callers 2

addIsActiveStreamMethod · 0.95
StreamIsActiveMethod · 0.95

Calls 3

generateKeyFunction · 0.85
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected