send_signal
send_signal transmits a signal to any active "Listen" diagram elements for this app or a different app using "push" style messaging.
Broadcasting within the app
by default, send_signal broadcasts a message to all running instances of the current app. You can broadcast to an different app by providing the url argument. The url argument should be a fully qualified url pointing to the back end php server entrypoint for the app. e.g. https://192.168.1.160/myApp/backend/backend.php
Server to Server communications
because of same-domain security restrictions, send_signal will always run as a server call when broadcasting to a different app. That means that communicaion between apps passes from server to server (or from the server to/from itself if both apps are located on the same server)
communication is not secure!
Broadcast messaging is not secure. It should be used for informing the app (or another app) that something has occurred, but it is unwise to send sensitive information between apps using this method
communication is non-blocking and non-buffered
The push messaging system that Exotool employs by default is non-blocking, meaning that when a message is broadcast, there is no gurantee that any other instance received the message. It is also non-buffered. Non-buffered means that when a "Listen" element starts listening for messages, it only receives those messages that were broadcast after it started listening.
Format:
send_signal(message [,channel] [,url])
Parameters:
| Parameter | Type | Description |
|---|---|---|
| message | mixed | The value of the message to transmit. this can be any value |
| channel | string |  [Optional]The channel key for the channel we are sending to (default is 'default') |
| app_name | string |  [Optional]name of the target app (e.g. "MyBroadcastApp") or server entrypoint URL for the target app. (e.g. https://192.168.1.160/myApp/backend/backend.php). When a URL is passed, it must be a fully qualified URL including the protocol component (e.g. "http:" or https"). If the name of another app is passed, Exotool will attempt to compute the entrypoint for the other app based on the assumption that both apps are co-located under the same directory path on the same server |
Examples
send_signal("I just logged in!", "logins")
send_signal("I just logged in!", "logins", "myOtherApp")
send_signal("I just logged in!", "logins", "https://192.168.1.160/myOtherApp/backend/backend.php")