compact method
Compact the notification queue. If dryRun is true, yields
each notification key that WOULD be removed without performing
the deletion. If false, performs the compaction and yields
each key as it is removed.
Implementation
@override
Stream<String> compact(bool dryRun) async* {
final expired = await (await getExpiredKeys()).toList();
if (dryRun) {
yield* Stream.fromIterable(expired);
return;
}
for (final id in expired) {
await remove(id, skipCommit: true);
yield id;
}
}