getExpiredKeys method

  1. @override
Future<Stream<String>> getExpiredKeys()
override

Streams all keys that have expired. The returned Future completes once the backend has accepted the request (surfacing any setup failure eagerly); the Stream then yields the keys.

Implementation

@override
Future<Stream<String>> getExpiredKeys() async {
  final now = _nowMillis();
  final rows = _db.raw.select(
      'SELECT atkey FROM at_data WHERE expires_at IS NOT NULL AND expires_at <= ?;',
      [now]);
  return Stream.fromIterable(rows.map((r) => r['atkey'] as String));
}