execute<TResult> method

  1. @mustCallSuper
Future<TResult> execute<TResult>(
  1. CommandBase<TEvent, TResult> command
)

Adds the command to the commands queue.

Implementation

@mustCallSuper
Future<TResult> execute<TResult>(CommandBase<TEvent, TResult> command) {
  if (_commandsQueue.isNotEmpty ||
      _commandsQueue.isEmpty && !command.handle(_eventsQueue)) {
    _commandsQueue.add(command);
  }
  return command.future;
}