ArgosPacketStorage class
Persists captured records behind a single serialized operation queue with an in-memory cache as the source of truth.
Concurrency: every mutating and reading operation runs as a task on
_opChain, so appends, clears and reads observe a total order — a clear
can never be silently undone by an in-flight write.
Performance: the cache is the authority, so a read never touches the adapter
after hydration and a write never re-decodes the store. The only synchronous
CPU cost left — jsonEncode — is coalesced: mutations mark the cache dirty
and a throttled timer flushes at most once per persistInterval. Reads never
wait on that flush; they return the cache immediately.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- persistInterval ↔ Duration
-
How long to coalesce writes before flushing to the adapter.
Duration.zerodisables coalescing (persist on every write — no crash-loss window).getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
append(
ArgosHttpInfo info, {int maxRecords = 200, int resourceMaxRecords = 50, String routeName = ''}) → Future< void> - Append a captured HTTP record. Trims oldest entries of the same kind when its per-kind cap is exceeded.
-
appendRecord(
ArgosPacketRecord record, {int maxRecords = 200, int resourceMaxRecords = 50}) → Future< void> - Append a pre-built ArgosPacketRecord (e.g. from native capture).
-
clear(
) → Future< void> - Clears all stored records. Ordered with writes and flushed immediately.
-
flush(
) → Future< void> - Forces any pending (coalesced) write to disk now. No-op when clean.
-
getAllAsync(
) → Future< List< ArgosPacketRecord> > - Returns all stored records sorted by startTimestamp descending. Reflects every operation issued before this call, straight from the cache.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAdapter(
ArgosStorageAdapter? adapter) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → ArgosPacketStorage
-
no setter