create_incoming_msg_listener()
  • 1 Minute to read

create_incoming_msg_listener()


Article summary

create_incoming_msg_listener()

Creates a listener to receive messages sent by external applications connected to the RESTful API

Reference

Arguments

ArgumentsType
callbackCallable ObjectFunction or method to be called when a message is received.

Return

None

Exceptions

ExceptionCondition
RayaInvalidCallbackNot valid callback provided.

See the Full List of Exceptions

Callback Arguments

Callback must receive the following arguments.

ArgumentsType
datadictjson compatible dictionary.

Examples

    self.communication.create_incoming_msg_listener(callback=self.incoming_msg_callback1)
    ....

    def incoming_msg_callback1(self, msg):
        self.log.info(f'Message received:')
        self.log.info(f'  msg: {msg}')

Was this article helpful?

What's Next