2 Event handlers
ni-richard edited this page 2019-09-17 00:48:06 +02:00

Imagine event handlers as callbacks that are invoked when TFW receives a specific type of message. For instance, you could send a message to the framework when the user does something of note. They are subscribed to a specific set of keys and messages are forwarded to them when one of their keys is the prefix of the one in the message.

Event handlers allow you to define actions triggered on the backend when the user presses a button on the frontend or moves the cursor to a specific area, etc.

They use ZeroMQ to connect to the framework. Due to this they are as loosely-coupled as possible: usually they are running in separate processes and only communicate with TFW through ZMQ.