scanAfter method
Implementation
@override
List<StoredOutboxFrame> scanAfter(Epoch cursor) {
final entries = <Epoch, Uint8List>{};
var deletedThrough = 0;
for (final record in _records()) {
final epoch = record['epoch'] as int;
switch (record['op']) {
case 'put':
entries[epoch] = Uint8List.fromList(
(record['frame'] as List<dynamic>).cast<int>(),
);
case 'delete':
if (epoch > deletedThrough) deletedThrough = epoch;
}
}
final effective = cursor > deletedThrough ? cursor : deletedThrough;
final epochs = entries.keys.where((epoch) => epoch > effective).toList()
..sort();
return epochs.map((epoch) => (epoch, entries[epoch]!)).toList();
}