MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / Global

Function Global

internal/sessions/manager.go:43–50  ·  view source on GitHub ↗

Global returns the process-wide session manager.

()

Source from the content-addressed store, hash-verified

41
42// Global returns the process-wide session manager.
43func Global() *Manager {
44 globalManagerOnce.Do(func() {
45 mgr := NewManager(defaultExpiry)
46 globalManagerPtr.Store(mgr)
47 go mgr.cleanupLoop()
48 })
49 return globalManagerPtr.Load()
50}
51
52// SwapGlobal replaces the global manager (for testing) and returns the previous one.
53func SwapGlobal(mgr *Manager) *Manager {

Callers 15

StartMethod · 0.92
waitForSessionMethod · 0.92
onNewSessionMethod · 0.92
reregisterSessionsMethod · 0.92
enqueueAndAwaitFunction · 0.92
enqueueToolActionFunction · 0.92
StartSessionListenerMethod · 0.92
StopSessionListenerMethod · 0.92
HandleMethod · 0.92
observeSessionMethod · 0.92
GetSessionsMethod · 0.92
GetSessionMethod · 0.92

Calls 4

cleanupLoopMethod · 0.95
NewManagerFunction · 0.70
DoMethod · 0.65
LoadMethod · 0.65

Tested by

no test coverage detected