Backend Architecture - TUMFARSynchrony/SynthARium GitHub Wiki
Contents
Overview
This page outlines general concepts used and gives an overview over the backend architecture.
For more details about specific classes, please see code documentation.
User, Participant and Experimenter
User Base Class
User
acts as a base class for all user types.
It handles common functionality, such as: the connection, parsing of incoming messages and subscribing to other users streams.
Subclasses of User
use the on_message
function to add listeners for incoming messages from the client.
Participant and Experimenter
The subclasses of User
, Participant
and Experimenter
, provide API endpoints specific to the user type.
Each instance of Participant
or Experimenter
represents a connected participant / experimenter. When the connected user disconnects, the class instance is removed.
SessionManager
The SessionManager implements loading and saving sessions from / to permanent storage. If a session is updated, the SessionManager will update the data on the permanent storage.
Data module
The data module includes the following python data classes: SessionData
, ParticipantData
, PositionData
, SizeData
and the private _BaseDataClass
.
When data in one of the above classes is modified, e.g. because a SAVE_SESSION request, the classes detect the changes and notify the SessionManager
, so that it can update the data on the permanent storage.
Connection
For details about the Connection and SubConnection, see: connection protocol
Experiment
An experiment is an instantiated session, which is created when a experimenter starts an experiment. It is based on a session and allows participants to connect.
[Authors] Alexander Liebald