MCPcopy
hub / github.com/MagicStack/asyncpg / _cleanup

Method _cleanup

asyncpg/connection.py:1579–1593  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1577 self._protocol = None
1578
1579 def _cleanup(self):
1580 self._call_termination_listeners()
1581 # Free the resources associated with this connection.
1582 # This must be called when a connection is terminated.
1583
1584 if self._proxy is not None:
1585 # Connection is a member of a pool, so let the pool
1586 # know that this connection is dead.
1587 self._proxy._holder._release_on_close()
1588
1589 self._mark_stmts_as_closed()
1590 self._listeners.clear()
1591 self._log_listeners.clear()
1592 self._query_loggers.clear()
1593 self._clean_tasks()
1594
1595 def _clean_tasks(self):
1596 # Wrap-up any remaining tasks associated with this connection.

Callers 2

closeMethod · 0.95
terminateMethod · 0.95

Calls 5

_mark_stmts_as_closedMethod · 0.95
_clean_tasksMethod · 0.95
_release_on_closeMethod · 0.80
clearMethod · 0.80

Tested by

no test coverage detected