tryRecordAttempt abstract method

Future<bool> tryRecordAttempt(
  1. Session session, {
  2. required String key,
  3. Map<String, String>? extraData,
})

Atomically admits and records an attempt if budget remains.

Returns true when recorded, or false when rejected. Rejected attempts are not recorded and invoke RateLimiterConfig.onRateLimitExceeded. Admitted attempts survive a rollback of the caller's transaction.

Implementation

Future<bool> tryRecordAttempt(
  final Session session, {
  required final String key,
  final Map<String, String>? extraData,
});