Skip to content

Smart Reflect Server Terminology

Derrick Gold edited this page May 30, 2016 · 2 revisions

General Terms

Display: This refers to the JavaScript code running in the browser that is aware of the browser it is running in. That is, it can retrieve details about the browser platform, insert new JavaScript and CSS files, as well as modifying the body HTML content. This is the link between the daemon and the browser used for loading and unloading plugins.

Plugin: This refers to the plugin instance as we know it locally within the daemon. It is unaware of the Display. Its job is for sending and receiving commands from the plugin client.

Plugin Client: This refers to the JavaScript instantiated plugin running in the display.

Scripts

Script: A script refers to any external program a plugin may call.

Script Types: Defines the running behavior of a Plugin's script. There are 3 types of scripts: 'One Shot', 'Periodic', and 'Persistent'.

Script Types

  • One Shot: Defines a script that when executed once, is no longer executed again until a plugin is disabled/enabled, or if a plugin is reloaded while it is enabled.

  • Periodic: Defines a script, that runs without states (i.e. relies on no run time context) that is scheduled to execute every X seconds (via plugin.conf file), and must exit before being executed again.

OneShot/Periodic Script Exectution

![OneShot and Periodic Script Execution] (https://raw.githubusercontent.com/DerrickGold/SmartReflectServer/master/ScreenShots/wiki/OneShotPeriodic.png)

  • Persistent: Defines a script running autonomously in a child processes. This script is given the details needed to connect to the appropriate plugin client, and is responsible for receiving and sending its own data. Scripts of these types are responsible for terminating themselves if the daemon shuts down. A signal will be sent to these processes to cleanly shutdown on their own.

Persistent Script Execution

![Persistent Script Execution] (https://raw.githubusercontent.com/DerrickGold/SmartReflectServer/master/ScreenShots/wiki/Persistent.png)

API

Plugin Client API: Refers to the format and types of commands that can be sent to a Plugin Client. This is the API that a persistent type script would utilize, and is the API that the daemon uses via plugins.

Display API: Refers to the format and types of commands that can be sent to the Display. Examples of such commands are loading/unloading plugins, and getting display information (browser window size).

API: Refers to the high level interface for the daemon itself. It is capable of: sending and receiving plugin information, sending and receiving display information, shutting the daemon down, modifying plugin configurations, and saving and loading plugin client related information. Encompasses Plugin Client API and Display API features, as well as internal Plugin features.