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

Function SwapGlobal

internal/sessions/manager.go:53–57  ·  view source on GitHub ↗

SwapGlobal replaces the global manager (for testing) and returns the previous one.

(mgr *Manager)

Source from the content-addressed store, hash-verified

51
52// SwapGlobal replaces the global manager (for testing) and returns the previous one.
53func SwapGlobal(mgr *Manager) *Manager {
54 globalManagerOnce.Do(func() {}) // ensure initialized
55 prev := globalManagerPtr.Swap(mgr)
56 return prev
57}
58
59// NewManager creates a new Manager with the given session expiry duration.
60func NewManager(expiry time.Duration) *Manager {

Calls 2

SwapMethod · 0.80
DoMethod · 0.65