Documentation
¶
Overview ¶
Package recstream broadcasts pressure-driven RecommendationEvents from the daemon's ingest loop to subscribers (the /api/recommendations/live SSE handler and, in B3b, the ccx run --supervise process).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub fans out RecommendationEvents to active subscribers.
func (*Hub) Close ¶
func (h *Hub) Close()
Close closes all subscriber channels and prevents future publishing.
func (*Hub) Publish ¶
func (h *Hub) Publish(ev contracts.RecommendationEvent)
Publish broadcasts ev to subscribers without blocking on slow receivers.
type StateMachine ¶
type StateMachine struct {
// contains filtered or unexported fields
}
StateMachine tracks the last pressure band observed per profile.
func NewStateMachine ¶
func NewStateMachine() *StateMachine
NewStateMachine creates a pressure-band state machine.
func (*StateMachine) Observe ¶
func (sm *StateMachine) Observe(profile string, pct float64) (bool, contracts.RecommendationLevel)
Observe records profile's current pressure and reports upward threshold crossings.
Click to show internal directories.
Click to hide internal directories.