enqueue method

void enqueue(
  1. QueuedCommand command
)

Add a command to the queue. Defaults priority to 'next'.

Implementation

void enqueue(QueuedCommand command) {
  _commandQueue.add(
    QueuedCommand(
      value: command.value,
      mode: command.mode,
      priority: command.priority,
      skipSlashCommands: command.skipSlashCommands,
      isMeta: command.isMeta,
      agentId: command.agentId,
      origin: command.origin,
      pastedContents: command.pastedContents,
    ),
  );
  _notifySubscribers();
  final content = command.value is StringCommandValue
      ? (command.value as StringCommandValue).value
      : null;
  _logOperation(QueueOperation.enqueue, content);
}