langgraph_agent_toolkit.core.memory.pool module

Bound connection checks and close database sessions after cancellation.

class langgraph_agent_toolkit.core.memory.pool.CancellableAsyncConnection(pgconn, row_factory=cast(AsyncRowFactory[Row], tuple_row))[source][source]

Bases: AsyncConnection

Close the socket when cancellation makes the operation result uncertain.

Parameters:
  • pgconn (PGconn)

  • row_factory (AsyncRowFactory[Row])

async wait(gen, interval=0.1)[source][source]
Parameters:

interval (float)

class langgraph_agent_toolkit.core.memory.pool.CheckedAsyncConnectionPool(*args, health_check_timeout=5.0, **kwargs)[source][source]

Bases: AsyncConnectionPool

Include the health probe in the checkout deadline and preserve cancellation.

Parameters:

health_check_timeout (float)

__init__(*args, health_check_timeout=5.0, **kwargs)[source][source]
Parameters:

health_check_timeout (float)

async getconn(timeout=None)[source][source]
Parameters:

timeout (float | None)