Async in MPS Python Client

8 次查看(过去 30 天)
Jasper
Jasper 2025-10-8
回答: Satyam 2025-10-15
Is it, or will it be, possible to send async requests to a Matlab Production Server via Python? I know it is possible in the ctf, and also in the restful API, but currently it is not implemented in the Mathworks Python Client package, as far as I know. Thanks in advance!

回答(1 个)

Satyam
Satyam 2025-10-15
Hi Jasper,
Currently, the MATLAB Production Server Python client (matlab-prodserver-client) only supports synchronous function calls. There isn’t yet a built-in way to submit asynchronous requests (like you can with the mode=async option in the RESTful API or through compiled CTFs).
That said, MPS itself does support asynchronous execution through its RESTful interface. So if you need async behavior from Python right now, the workaround is to call the REST API directly — for example, by making a POST request with mode=async, polling the status, and fetching the results once they’re ready. This can be done with standard HTTP libraries such as requests or httpx (and combined with asyncio if you want non-blocking behavior).
Here is an article guiding you how to send an asynchronous requests via the MPS RESTful API: https://www.mathworks.com/help/mps/restfuljson/postasynchronousrequest.html

类别

Help CenterFile Exchange 中查找有关 RESTful API 的更多信息

产品


版本

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by