diff --git a/Intent-and-scope.md b/Intent-and-scope.md deleted file mode 100644 index f7de697..0000000 --- a/Intent-and-scope.md +++ /dev/null @@ -1 +0,0 @@ -Empty. \ No newline at end of file diff --git a/Key,-intent-and-scope.md b/Key,-intent-and-scope.md new file mode 100644 index 0000000..c644dc3 --- /dev/null +++ b/Key,-intent-and-scope.md @@ -0,0 +1,10 @@ +TFW messages have these three essential properties that are described below. You have to add these to the *JSON object* either explicitly, or implicitly by calling the `send_message` method on a server connector. In case of the latter, you only have to provide the key, the default values for the *intent* property is `"control"` and `"zmq"` for *scope*. + +### Key +It indicates the domain of the message along with a command like `message.send`. You can define your own ones and send it to the TFW server, but nothing will happen until you create an event handler, which listens to that exact key. + +### Intent +This property has to accepted values: `"control"` and `"event"`. The former used to instruct an event handler to perform an action and the latter emits information about something's state. This distinction is really important, because the lack of intent could lead to infinite recursion in event handlers. + +### Scope +This one specifies the direction of the message: `"zmq"`, `"websocket"`, `"broadcast"`. Their names are quite talkative, the first one forwards the message to the event handlers, the second one goes to the frontend and the third one is send to both directions. \ No newline at end of file