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

Function make_request

gunicorn/dirty/protocol.py:655–677  ·  view source on GitHub ↗

Build a request message dict. Args: request_id: Unique request identifier (int or str) app_path: Import path of the dirty app (e.g., 'myapp.ml:MLApp') action: Action to call on the app args: Positional arguments kwargs: Keyword arguments Returns

(request_id, app_path: str, action: str,
                 args: tuple = None, kwargs: dict = None)

Source from the content-addressed store, hash-verified

653
654# Message builder helpers (backwards compatible with old API)
655def make_request(request_id, app_path: str, action: str,
656 args: tuple = None, kwargs: dict = None) -> dict:
657 """
658 Build a request message dict.
659
660 Args:
661 request_id: Unique request identifier (int or str)
662 app_path: Import path of the dirty app (e.g., 'myapp.ml:MLApp')
663 action: Action to call on the app
664 args: Positional arguments
665 kwargs: Keyword arguments
666
667 Returns:
668 dict: Request message dict
669 """
670 return {
671 "type": DirtyProtocol.MSG_TYPE_REQUEST,
672 "id": request_id,
673 "app_path": app_path,
674 "action": action,
675 "args": list(args) if args else [],
676 "kwargs": kwargs or {},
677 }
678
679
680def make_response(request_id, result) -> dict:

Callers 4

_execute_lockedMethod · 0.70
execute_asyncMethod · 0.70
_start_requestMethod · 0.70
_start_requestMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected