@needs_zmq
def send_message(subject, message):
    if not _conn_details.source:
        # we're in the parent process so just call the handler
        for handler in _handlers.get(subject, []):
            handler(subject, message)
        return

    # otherwise send it via zmq
    data, compressed = _serializer.serialize((subject, message))
    _conn_details.source.send(data, flags=zmq.SNDMORE)
    _conn_details.source.send_json(compressed)
Send a message to the parent process to be handled by a registered handler.
dataset/ETHPy150Open manahl/mdf/mdf/remote/messaging.py/send_message