StreamJsonWriter class
Streams AgentEvents as stream-json lines — one emit per line.
AgentListener-shaped on purpose (like the HEP writer): the headless
run wires it with agent.subscribe(writer.handleEvent) and the host
owns the stdout sink. writeHeader must be called first; it is a
no-op after the first line.
Constructors
- StreamJsonWriter({required void emit(String line)})
-
Creates a writer emitting to
emit(hosts pass a stdout line sink).
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
handleEvent(
AgentEvent event, CancelToken? cancelToken) → Future< void> - Handles one agent event (AgentListener shape); filtered events emit nothing.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
writeHeader(
{required String sessionId, required String cwd, DateTime? timestamp}) → void - Emits the session header line (once; further calls are no-ops).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited