def _fetch(self):
if self.closed():<EOL><INDENT>raise self.Error("<STR_LIT>".format(self.server.address))<EOL><DEDENT>if self.defunct():<EOL><INDENT>raise self.Error("<STR_LIT>".format(self.server.address))<EOL><DEDENT>if not self.responses:<EOL><INDENT>return <NUM_LIT:0>, <NUM_LIT:0><EOL><DEDENT>self._receive()<EOL>details, summary_signature, summary_metadata = self._unpack()<EOL>if details:<EOL><INDENT>log_debug("<STR_LIT>", self.local_port, len(details))  <EOL>self.responses[<NUM_LIT:0>].on_records(details)<EOL><DEDENT>if summary_signature is None:<EOL><INDENT>return len(details), <NUM_LIT:0><EOL><DEDENT>response = self.responses.popleft()<EOL>response.complete = True<EOL>if summary_signature == b"<STR_LIT>":<EOL><INDENT>log_debug("<STR_LIT>", self.local_port, summary_metadata)<EOL>response.on_success(summary_metadata or {})<EOL><DEDENT>elif summary_signature == b"<STR_LIT>":<EOL><INDENT>self._last_run_statement = None<EOL>log_debug("<STR_LIT>", self.local_port)<EOL>response.on_ignored(summary_metadata or {})<EOL><DEDENT>elif summary_signature == b"<STR_LIT>":<EOL><INDENT>self._last_run_statement = None<EOL>log_debug("<STR_LIT>", self.local_port, summary_metadata)<EOL>response.on_failure(summary_metadata or {})<EOL><DEDENT>else:<EOL><INDENT>self._last_run_statement = None<EOL>raise ProtocolError("<STR_LIT>" % summary_signature)<EOL><DEDENT>return len(details), <NUM_LIT:1><EOL>
Receive at least one message from the server, if available.

        :return: 2-tuple of number of detail messages and number of summary messages fetched