bluesky_queueserver.ZMQCommSendAsync.send_message

async ZMQCommSendAsync.send_message(*, method, params=None, timeout=None, raise_exceptions=None)[source]

Send message to ZMQ server and wait for the response. The message must contain a name of a method supported by the server and a dictionary of parameters that are required by the method. In case of communication error (timeout), the function returns error message or raises CommTimeoutError exception depending on the values raise_exceptions parameter in this function and class constructor.

Parameters:
method: str

Name of the method to be invoked on the server. The method must be supported by the server.

params: dict or None

Dictionary of parameters passed to the method. If None, then an empty dictionary is passed to the server.

timeout: int or None

Read timeout (in ms) for the single request. If None, then the default timeout is used.

raise_exceptions: bool or None

The flag indicates if exception should be raised in case of communication error (such as timeout). If False, then error message is returned instead. If None, then the field value self._raise_exceptions is used to determine if the exception needs to be raised. Non-blocking calls do not raise the exception. Instead, callback function receives the error message as one of the parameters

Returns:
dict

Message returned by the server.

Raises:
CommTimeoutError

Raised if communication error occurs and raise_timeout_exceptions is set True.