Contenido principal

matlab.production_server.client.MWHttpAsyncClient

R2026b

Namespace: matlab.production_server

Python object encapsulating a connection to a MATLAB Production Server instance for making non-blocking function calls

Description

The matlab.production_server.client.MWHttpAsyncClient class creates a connection object that encapsulates the connection between the client and a MATLAB® Production Server™ instance. Once the connection is created, you can make non-blocking calls to MATLAB functions hosted on the server instance.

Construction

my_client = MWHttpAsyncClient(url,[ssl_context=ssl_context])

Input Arguments

expand all

URL of the server instance to which the client connects, specified as a string. This server instance hosts the MATLAB functions which the client can evaluate.

SSL protocol to use for client-server communication, specified as an ssl.SSLContext object. The Python® client library uses the Python ssl library library for supporting HTTPS requests to server instances. For information about the SSL protocols that the server supports, see ssl-protocols.

This argument is required if the URL to connect to the server instance uses HTTPS.

HTTPS communication using the Python client API is supported only on Windows® and Linux® platforms. macOS is not supported.

Examples

collapse all

Initialize the client to run functions deployed to a MATLAB Production Server instance running on localhost:9910.

from production_server import async_client
client = async_client.MWHttpAsyncClient("http://localhost:9910"))

Call function myFunc from archive myArchive with 2 inputs and 3 outputs, using double-dot syntax to specify the archive and the function to call. The client outputs a matlab.production_server.client.Future object.

future = client.myArchive.myFunc(input1, input2, nargout=3)

More About

expand all