/**
* {@inheritdoc}
*/
public function executeCommand(CommandInterface $command, callable $callback)
{
if ($this->buffer->isEmpty() && ($stream = $this->getResource())) {
$this->loop->addWriteStream($stream, $this->writableCallback);
}
$request = $this->serializer->getRequestMessage($command->getId(), $command->getArguments());
$this->buffer->append($request);
$this->commands->enqueue([$command, $callback]);
}