append method

Future<void> append(
  1. ArgosHttpInfo info, {
  2. int maxRecords = 200,
  3. int resourceMaxRecords = 50,
  4. String routeName = '',
})

Append a captured HTTP record. Trims oldest entries of the same kind when its per-kind cap is exceeded.

Returns the op future so a caller (e.g. a test) can await this specific write's effect on the cache — not its eventual disk flush.

Implementation

Future<void> append(ArgosHttpInfo info,
    {int maxRecords = 200,
    int resourceMaxRecords = 50,
    String routeName = ''}) {
  final json = info.toJson();
  json['routeName'] = routeName;
  final record = ArgosPacketRecord.fromJson(json);
  return _enqueueWrite(record.toJson(), maxRecords, resourceMaxRecords);
}