TrinityEventBus class
Singleton broadcast event bus shared by all three trinity sub-systems.
Every CausalEvent from recoverable_app, ui_explainer, and causality_flutter flows through this bus. The CausalGraph subscribes to it, DevTools polls the buffer, and any user code can listen via stream.
Rule: No sub-system imports from another sub-system. All cross-system communication happens through this bus.
Properties
-
buffer
→ List<
CausalEvent> -
Unmodifiable view of the event buffer (oldest first).
no setter
- bufferLength → int
-
The current buffer size.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastEvent → CausalEvent?
-
Returns the last event in the buffer, or null if empty.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
CausalEvent> -
Broadcast stream — multiple listeners can subscribe simultaneously.
no setter
Methods
-
bufferWhere(
CausalEventType type) → List< CausalEvent> -
Returns events filtered by
type. Useful for DevTools panels that show only crash events, only layout events, etc. -
debugClear(
) → void - Clears the buffer. Only works in debug/test mode (inside assert).
-
dispose(
) → void - Closes the stream controller. Call only on app dispose.
-
emit(
CausalEvent event) → void - Emit an event to all listeners and add it to the buffer.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → TrinityEventBus
-
The singleton instance. All sub-systems use this.
final