MCPcopy Index your code
hub / github.com/docker/docker-agent / NewSessionManager

Function NewSessionManager

pkg/server/session_manager.go:91–111  ·  view source on GitHub ↗

NewSessionManager creates a new session manager.

(ctx context.Context, sources config.Sources, sessionStore session.Store, refreshInterval time.Duration, runConfig *config.RuntimeConfig)

Source from the content-addressed store, hash-verified

89
90// NewSessionManager creates a new session manager.
91func NewSessionManager(ctx context.Context, sources config.Sources, sessionStore session.Store, refreshInterval time.Duration, runConfig *config.RuntimeConfig) *SessionManager {
92 loaders := make(config.Sources)
93 for name, source := range sources {
94 loaders[name] = newSourceLoader(ctx, source, refreshInterval)
95 }
96
97 sm := &SessionManager{
98 runtimeSessions: concurrent.NewMap[string, *activeRuntimes](),
99 deletedSessions: concurrent.NewMap[string, *activeRuntimes](),
100 eventLogs: concurrent.NewMap[string, *pumpedEventLog](),
101 followUpInjectors: concurrent.NewMap[string, FollowUpInjector](),
102 followUpKeys: concurrent.NewMap[string, *idempotencyCache](),
103 sessionStore: sessionStore,
104 Sources: loaders,
105 refreshInterval: refreshInterval,
106 runConfig: runConfig,
107 sessionReady: make(chan struct{}),
108 }
109
110 return sm
111}
112
113func (sm *SessionManager) markReady() {
114 sm.sessionReadyOnce.Do(func() { close(sm.sessionReady) })

Calls 2

NewMapFunction · 0.92
newSourceLoaderFunction · 0.85