MCPcopy
hub / github.com/psycopg/psycopg / set

Method set

psycopg_pool/psycopg_pool/pool.py:893–905  ·  view source on GitHub ↗

Signal the client waiting that a connection is ready. Return True if the client has "accepted" the connection, False otherwise (typically because wait() has timed out).

(self, conn: CT)

Source from the content-addressed store, hash-verified

891 return self.conn
892
893 def set(self, conn: CT) -> bool:
894 """Signal the client waiting that a connection is ready.
895
896 Return True if the client has "accepted" the connection, False
897 otherwise (typically because wait() has timed out).
898 """
899 with self._cond:
900 if self.conn or self.error:
901 return False
902
903 self.conn = conn
904 self._cond.notify_all()
905 return True
906
907 def fail(self, error: Exception) -> bool:
908 """Signal the client that, alas, they won't have a connection today.

Callers 15

enterabsMethod · 0.45
_add_to_poolMethod · 0.45
_add_to_poolMethod · 0.45
_add_to_poolMethod · 0.45
enterabsMethod · 0.45
listenerFunction · 0.45
copy_taskFunction · 0.45
test_copy_concurrencyFunction · 0.45
listenerFunction · 0.45
test_wait_rFunction · 0.45
test_wait_r_no_linuxFunction · 0.45
writerFunction · 0.45

Calls

no outgoing calls

Tested by 15

listenerFunction · 0.36
copy_taskFunction · 0.36
test_copy_concurrencyFunction · 0.36
listenerFunction · 0.36
test_wait_rFunction · 0.36
test_wait_r_no_linuxFunction · 0.36
writerFunction · 0.36
test_wait_r_nowaitFunction · 0.36
copy_taskFunction · 0.36
test_copy_concurrencyFunction · 0.36
workerFunction · 0.36