MCPcopy Index your code
hub / github.com/tinode/chat / Range

Method Range

server/sessionstore.go:193–201  ·  view source on GitHub ↗

Range calls given function for all sessions. It stops if the function returns false.

(f func(sid string, s *Session) bool)

Source from the content-addressed store, hash-verified

191
192// Range calls given function for all sessions. It stops if the function returns false.
193func (ss *SessionStore) Range(f func(sid string, s *Session) bool) {
194 ss.lock.Lock()
195 for sid, s := range ss.sessCache {
196 if !f(sid, s) {
197 break
198 }
199 }
200 ss.lock.Unlock()
201}
202
203// Shutdown terminates sessionStore. No need to clean up.
204// Don't send to clustered sessions, their servers are not being shut down.

Callers 5

serveStatusFunction · 0.80
runMethod · 0.80
topicsStateForUserMethod · 0.80
stopTopicsForUserMethod · 0.80
invalidateProxySubsMethod · 0.80

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected