Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
EventBus — AI Engine Event Infrastructure V2
事件分层路由:
- Transient → WS only(不入库,不 replay,丢失没关系)
- Persistent → DB + WS + Sequence(状态恢复、Timeline 重建)
- Audit → DB only(不推送 WS)
Phase 2 roadmap:
- timeline_patch: PatchImportance tiers (structural/visual/ephemeral), only structural persists
- Client: Snapshot + Incremental Events instead of full replay
- inferGrade: remove fallback, all emitters set Grade explicitly
func NewEventBus ¶
func NewEventBus( repo repository.EventRepository, pub Publisher, ) *EventBus
func (*EventBus) Publish ¶
Publish 按事件等级分流:
- Transient: 仅 push WS
- Persistent: 写 DB(分配 sequence)+ push WS
- Audit: 仅写 DB
如果 event.Grade 为空,则通过 inferGrade 自动推断。
func (*EventBus) PublishToChannel ¶
PublishToChannel 直接向指定 WS channel 推送事件,不写 DB。 专用于回放等只需 WS 输出的场景。
Click to show internal directories.
Click to hide internal directories.