recordImpression method

  1. @override
Future<void> recordImpression(
  1. String slot
)
override

Records an impression for slot (and globally).

Implementation

@override
Future<void> recordImpression(String slot) async {
  if (!_hydrationDone) await _hydrated;
  final ts = _now().millisecondsSinceEpoch;
  _apply(slot, ts);
  _apply(_globalSlot, ts);
  _enqueuePersist(slot);
  _enqueuePersist(_globalSlot);
  // The returned future resolves once THIS record has persisted (callers
  // fire it un-awaited in production; awaiting it means durability). The
  // decision itself was committed synchronously above.
  return _writeQueue;
}