sendCommand<T> method
Future<T>
sendCommand<T>(
- Command command,
- ResponseParser<
T> parser, { - bool returnCompleter = true,
Queues the specified command for sending to the server.
The response is parsed using parser, by default the
completer's future is returned unless you set
returnCompleter to false.
Implementation
Future<T> sendCommand<T>(
Command command,
ResponseParser<T> parser, {
bool returnCompleter = true,
}) {
final task = CommandTask<T>(command, nextId(), parser);
_tasks[task.id] = task;
queueTask(task);
return returnCompleter ? task.completer.future : Future<T>.value();
}