requeueFront method

void requeueFront(
  1. List<EventRequest> events
)

Puts events back at the front of the queue, oldest first, ahead of anything queued since. Events beyond capacity are dropped from the end.

Implementation

void requeueFront(List<EventRequest> events) {
  for (final event in events.reversed) {
    _queue.addFirst(event);
  }
  while (_queue.length > _maxQueueSize) {
    final dropped = _queue.removeLast();
    LinkFortyLogger.log(
        'Event queue full, dropping event: ${dropped.eventName}');
  }
}