MCPcopy Create free account
hub / github.com/BaseXdb/basex / iter_receive

Method iter_receive

basex-api/src/main/python/BaseXClient/BaseXClient.py:234–249  ·  view source on GitHub ↗

iter_receive() -> (typecode, item) iterate while the query returns items. typecode list is in https://docs.basex.org/wiki/Server_Protocol:_Types

(self)

Source from the content-addressed store, hash-verified

232 return self.recv_c_str()
233
234 def iter_receive(self):
235 """iter_receive() -> (typecode, item)
236
237iterate while the query returns items.
238typecode list is in https://docs.basex.org/wiki/Server_Protocol:_Types
239"""
240 result = list()
241 self.__swrapper.clear_buffer()
242 typecode = self.__swrapper.recv_single_byte()
243 while typecode > 0:
244 result.append(self.__swrapper.recv_until_terminator())
245 typecode = self.__swrapper.recv_single_byte()
246 if not self.server_response_success():
247 raise IOError(self.recv_c_str())
248 for ba in result:
249 yield ba.decode(self.__swrapper.receive_bytes_encoding)
250
251
252# ---------------------------------

Callers 1

iterMethod · 0.80

Calls 7

recv_c_strMethod · 0.95
clear_bufferMethod · 0.80
recv_single_byteMethod · 0.80
recv_until_terminatorMethod · 0.80
appendMethod · 0.65
decodeMethod · 0.45

Tested by

no test coverage detected