FileStreamTraceSink class final
A buffered line sink over file: truncates whatever a previous run
left (ONE trace per file — each armed run replaces the last trail;
collect across runs by copying the file between runs), then appends
lines in batches. Concurrent armed runs share that one file: any
second armed fa boot — another terminal, or a detached child that
inherited FA_STREAM_TRACE (e.g. fa dap start spawning
hub serve) — truncates the live trail at its install. Copy the
file between runs when history matters. Batching keeps the per-mark
cost off the hot stream path (a sync fsync per SSE chunk would
perturb the very cadence being measured): lines flush on a
flushInterval timer, when the buffer crosses
_kFlushThresholdBytes, or on flush/dispose. The trade is
explicit — up to one interval of buffered lines is lost on a hard
kill. Diagnostics contract: an IO failure degrades to silence, never
throws into the caller.
- Implemented types
Constructors
- FileStreamTraceSink(File _file, {Duration flushInterval = const Duration(milliseconds: 250)})
-
Truncates
filefor a fresh trace and arms the flush timer.
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
-
dispose(
) → void - Cancels the timer and flushes the tail. The CLI never calls this (the trace is process-lifetime); tests and embedders may.
-
flush(
) → void - Writes any buffered lines now (also driven by the flush timer).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
writeLine(
String line) → void -
Receives one formatted trace body (no trailing newline).
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited