Documentation
¶
Index ¶
- type Manager
- func (m *Manager) CheckAndTransition(indexID core.IndexID) bool
- func (m *Manager) ForceSleep(indexID core.IndexID)
- func (m *Manager) ForceWake(indexID core.IndexID)
- func (m *Manager) GetActiveUsers() []core.IndexID
- func (m *Manager) GetBrainState(indexID core.IndexID) *core.BrainState
- func (m *Manager) GetSleepingUsers() []core.IndexID
- func (m *Manager) GetState(indexID core.IndexID) core.ActivityState
- func (m *Manager) IsActivitySparse(indexID core.IndexID) bool
- func (m *Manager) RecordActivity(indexID core.IndexID)
- func (m *Manager) RemoveIndex(indexID core.IndexID)
- func (m *Manager) SetCallbacks(onSleepStart func(core.IndexID), onSleepEnd func(core.IndexID), ...)
- func (m *Manager) SetThresholds(idle, sleep, dormant time.Duration)
- func (m *Manager) StartMonitor(checkInterval time.Duration)
- func (m *Manager) Stats() map[string]any
- func (m *Manager) Stop()
- func (m *Manager) Thresholds() (time.Duration, time.Duration, time.Duration)
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
}
Manager tracks activity and controls brain lifecycle states
func (*Manager) CheckAndTransition ¶
CheckAndTransition evaluates an index state and transitions if needed Returns true if a transition occurred
func (*Manager) ForceSleep ¶
ForceSleep forces an index into sleep state
func (*Manager) GetActiveUsers ¶
GetActiveUsers returns all indexes in Active or Idle state
func (*Manager) GetBrainState ¶
func (m *Manager) GetBrainState(indexID core.IndexID) *core.BrainState
GetBrainState returns the full brain state
func (*Manager) GetSleepingUsers ¶
GetSleepingUsers returns all indexes in Sleeping state
func (*Manager) GetState ¶
func (m *Manager) GetState(indexID core.IndexID) core.ActivityState
GetState returns the current state for an index
func (*Manager) IsActivitySparse ¶
IsActivitySparse checks if activity has become sparse (trigger for sleep)
func (*Manager) RecordActivity ¶
RecordActivity records an index activity event
func (*Manager) RemoveIndex ¶
RemoveIndex drops lifecycle state for an index.
func (*Manager) SetCallbacks ¶
func (m *Manager) SetCallbacks( onSleepStart func(core.IndexID), onSleepEnd func(core.IndexID), onDormant func(core.IndexID), onWake func(core.IndexID), )
SetCallbacks configures lifecycle transition callbacks
func (*Manager) SetThresholds ¶
SetThresholds applies lifecycle thresholds at runtime.
func (*Manager) StartMonitor ¶
StartMonitor starts the background lifecycle monitoring