MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / init_connections

Method init_connections

fastdeploy/engine/async_llm.py:310–328  ·  view source on GitHub ↗

Initialize high-performance ZMQ connections

(self)

Source from the content-addressed store, hash-verified

308 main_process_metrics.set_cache_config_info(obj=self.cfg.cache_config)
309
310 async def init_connections(self):
311 """Initialize high-performance ZMQ connections"""
312 try:
313 # Create ZMQ client for sending requests
314 self.request_client = ZmqIpcClient(name=self.engine_pid, mode=zmq.PUSH)
315 self.request_client.connect()
316
317 # Create high-performance async connection manager for receiving responses
318 self.connection_manager = DealerConnectionManager(
319 pid=self.engine_pid, max_connections=int(os.getenv("FD_DEALER_CONNECTIONS", 50))
320 )
321
322 if not self.connection_manager.running:
323 await self.connection_manager.initialize()
324
325 llm_logger.info("High-performance ZMQ connections initialized successfully")
326 except Exception as e:
327 llm_logger.error(f"Failed to initialize ZMQ connections: {e}")
328 raise
329
330 async def get_model_config(self):
331 """Get model configuration"""

Callers 3

lifespanFunction · 0.80
setUpClassMethod · 0.80
_testMethod · 0.80

Calls 6

ZmqIpcClientClass · 0.90
connectMethod · 0.45
initializeMethod · 0.45
infoMethod · 0.45
errorMethod · 0.45

Tested by 2

setUpClassMethod · 0.64
_testMethod · 0.64