MCPcopy
hub / github.com/benoitc/gunicorn / connect_async

Method connect_async

gunicorn/dirty/client.py:197–221  ·  view source on GitHub ↗

Establish async connection to arbiter. Raises: DirtyConnectionError: If connection fails

(self)

Source from the content-addressed store, hash-verified

195 # -------------------------------------------------------------------------
196
197 async def connect_async(self):
198 """
199 Establish async connection to arbiter.
200
201 Raises:
202 DirtyConnectionError: If connection fails
203 """
204 if self._writer is not None:
205 return
206
207 try:
208 self._reader, self._writer = await asyncio.wait_for(
209 asyncio.open_unix_connection(self.socket_path),
210 timeout=self.timeout
211 )
212 except asyncio.TimeoutError:
213 raise DirtyTimeoutError(
214 "Timeout connecting to dirty arbiter",
215 timeout=self.timeout
216 )
217 except (OSError, ConnectionError) as e:
218 raise DirtyConnectionError(
219 f"Failed to connect to dirty arbiter: {e}",
220 socket_path=self.socket_path
221 ) from e
222
223 async def execute_async(self, app_path, action, *args, **kwargs):
224 """

Callers 4

execute_asyncMethod · 0.95
__aenter__Method · 0.95
_start_requestMethod · 0.80

Calls 2

DirtyTimeoutErrorClass · 0.85

Tested by 1