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

Method _start_request

gunicorn/dirty/client.py:540–558  ·  view source on GitHub ↗

Send the initial request to the arbiter.

(self)

Source from the content-addressed store, hash-verified

538 return await self._read_next_chunk()
539
540 async def _start_request(self):
541 """Send the initial request to the arbiter."""
542 if self.client._writer is None:
543 await self.client.connect_async()
544
545 # Set deadline for entire stream
546 now = time.monotonic()
547 self._deadline = now + self.client.timeout
548 self._last_chunk_time = now
549
550 self._request_id = str(uuid.uuid4())
551 request = make_request(
552 self._request_id,
553 self.app_path,
554 self.action,
555 args=self.args,
556 kwargs=self.kwargs,
557 )
558 await DirtyProtocol.write_message_async(self.client._writer, request)
559
560 # Threshold for applying timeout wrapper (seconds)
561 # When remaining time is above this, skip timeout for performance

Callers 1

__anext__Method · 0.95

Calls 3

connect_asyncMethod · 0.80
make_requestFunction · 0.70
write_message_asyncMethod · 0.45

Tested by

no test coverage detected