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)
| 653 | |
| 654 | # Message builder helpers (backwards compatible with old API) |
| 655 | def 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 | |
| 680 | def make_response(request_id, result) -> dict: |
no outgoing calls
no test coverage detected