oasislmf.utils.ping¶
Functions¶
|
Sends a JSON message to either a websocket server or a socket server. |
|
Sends a JSON message to a target socket |
|
Sends a JSON message to a target websocket |
Module Contents¶
- oasislmf.utils.ping.oasis_ping(data)[source]¶
Sends a JSON message to either a websocket server or a socket server.
If analysis_pk is in the data, OASIS_WEBSOCKET_URL and OASIS_WEBSOCKET_URL are in environment, sends a websocket message. If analysis_pk but missing variables, no message sent. Else, websocket sent to OASIS_SOCKET_SERVER_IP OASIS_SOCKET_SERVER_PORT defaulted to 127.0.0.1 8888.
For a specific socket or websocket, use oasis_ping_socket or oasis_ping_websocket with the target location.
- Args:
data (dict): dictionary of data: JSON serialisable
- Returns:
Boolean: whether attempted call gets through