get method

  1. @override
Future<TaskStatus?> get(
  1. String taskId
)
override

Returns the latest task status if still within its TTL.

Implementation

@override
/// Returns the latest task status if still within its TTL.
Future<TaskStatus?> get(String taskId) async {
  final entry = _entries[taskId];
  if (entry == null) return null;
  if (entry.expiresAt.isBefore(stemNow())) {
    _remove(taskId);
    return null;
  }
  return entry.status;
}