handle method

  1. @override
bool handle(
  1. ListQueue<TEvent> eventQueue
)
override

Handle available events.

Returns true if the command is completed, or false if it needs more events.

If the method returns true, the command will never be called again.

This method is called when a command reaches the front of the command queue, and if it returns false, it's called again every time a new event becomes available.

Implementation

@override
bool handle(ListQueue<TEvent> eventQueue) {
  completer.complete(eventQueue.toList(growable: false));
  eventQueue.clear();
  return true;
}