salmon-lighter-12882
03/27/2025, 11:58 AMtall-airline-16756
03/27/2025, 11:59 AMtall-airline-16756
03/27/2025, 11:59 AMprewarm()
method is used to initialize a database connection in the connection pool if no connections currently exist. It starts a background task that creates a new connection using await self._connect()
and adds this connection to the available connections pool with self._available.add(conn)
. This process does not block the main execution flow.
Note that the method will not create a new connection if there are already existing connections or if a prewarming task is already running.
Sources: livekit.agents.utils.connection_pool API documentation