MCPcopy Create free account
hub / github.com/google/adk-python / cleanup

Method cleanup

src/google/adk/agents/remote_a2a_agent.py:819–832  ·  view source on GitHub ↗

Clean up resources, especially the HTTP client if owned by this agent.

(self)

Source from the content-addressed store, hash-verified

817 yield
818
819 async def cleanup(self) -> None:
820 """Clean up resources, especially the HTTP client if owned by this agent."""
821 if self._httpx_client_needs_cleanup and self._httpx_client:
822 try:
823 await self._httpx_client.aclose()
824 logger.debug("Closed HTTP client for agent %s", self.name)
825 except Exception as e:
826 logger.warning(
827 "Failed to close HTTP client for agent %s: %s",
828 self.name,
829 e,
830 )
831 finally:
832 self._httpx_client = None

Calls 1

acloseMethod · 0.45