MCPcopy
hub / github.com/psycopg/psycopg / _communicate_gen

Method _communicate_gen

psycopg/psycopg/_pipeline_base.py:108–122  ·  view source on GitHub ↗

Communicate with pipeline to send commands and possibly fetch results, which are then processed.

(self)

Source from the content-addressed store, hash-verified

106 yield from self._fetch_gen(flush=True)
107
108 def _communicate_gen(self) -> PQGen[None]:
109 """Communicate with pipeline to send commands and possibly fetch
110 results, which are then processed.
111 """
112 fetched = yield from pipeline_communicate(self.pgconn, self.command_queue)
113 exception = None
114 for results in fetched:
115 queued = self.result_queue.popleft()
116 try:
117 self._process_results(queued, results)
118 except e.Error as exc:
119 if exception is None:
120 exception = exc
121 if exception is not None:
122 raise exception
123
124 def _fetch_gen(self, *, flush: bool) -> PQGen[None]:
125 """Fetch available results from the connection and process them with

Callers 4

_sync_genMethod · 0.95
_exit_genMethod · 0.95
_execute_genMethod · 0.80

Calls 1

_process_resultsMethod · 0.95

Tested by

no test coverage detected