Documentation
¶
Index ¶
- type Manager
- func (m *Manager) BeginRequest(sessionID string)
- func (m *Manager) EndRequest(sessionID string, proxyErr error)
- func (m *Manager) GetSession(sessionID string) *SessionState
- func (m *Manager) Register(sessionID string, config herd.TenantConfig)
- func (m *Manager) Remove(sessionID string)
- func (m *Manager) StartReaper(ctx context.Context)
- func (m *Manager) UnregisterAndKill(sessionID string, reason string) error
- func (m *Manager) UpdateHeartbeat(sessionID string)
- type SessionState
- type WorkerReaper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(reaper WorkerReaper) *Manager
func (*Manager) BeginRequest ¶
BeginRequest is called by the proxy before routing. This is used for both REST and WebSockets.
func (*Manager) EndRequest ¶
EndRequest is deferred by the proxy. It catches deadlocks.
func (*Manager) GetSession ¶
func (m *Manager) GetSession(sessionID string) *SessionState
GetSession returns the session state if it exists (for testing or advanced logic) Returns nil if not found.
func (*Manager) Register ¶
func (m *Manager) Register(sessionID string, config herd.TenantConfig)
Register explicitly creates the session lease.
func (*Manager) StartReaper ¶
StartReaper starts the background loop to clean up workers. It should be run in a goroutine.
func (*Manager) UnregisterAndKill ¶
UnregisterAndKill removes the session from tracking and kills the worker. This is used for clean disconnects where we want to ensure no zombie processes.
func (*Manager) UpdateHeartbeat ¶
UpdateHeartbeat is called by the gRPC stream when a Ping arrives.
type SessionState ¶
type WorkerReaper ¶
WorkerReaper is the interface to your pool to execute a specific worker.