def read_commands_from_buffer(self):
        received_commands = 0
        while True:
            cmd_type, cmd_args, cmd_len = self._unpack_command(self._incoming_buffer)
            if not cmd_len:
                break

            received_commands += 1

            # Store our command on the command queue
            # Move the self._incoming_buffer forward by the number of bytes we just read
            self._incoming_commands.append((cmd_type, cmd_args))
            self._incoming_buffer = self._incoming_buffer[cmd_len:]

        return received_commands
Reads data from buffer --> command_queue
dataset/ETHPy150Open YelpArchive/python-gearman/gearman/connection.py/GearmanConnection.read_commands_from_buffer