public function getBacklogLength() : int
    {
        return array_reduce(
            $this->commandQueue,
            function ($a, CommandInterface $command) {
                if ($command instanceof Query || $command instanceof Sync) {
                    $a++;
                }
                return $a;
            },
            0);
    }