hyperion-start / hyperion-core

A Tmux based System Startup Engine
GNU General Public License v3.0
8 stars 3 forks source link

Split UIs from Hyperion Backend #23

Closed DavidPL1 closed 5 years ago

DavidPL1 commented 5 years ago

Change structure as shown by the below diagram, to split UI from backend.

This way multiple UIs can be started and won't interfere with each other, but all display the same state.

DavidPL1 commented 5 years ago

Approach:

  1. Create util.actionSerializer that is able to serialize all kinds of action calls to and all responses from a hyperion backend.

    • Encode as dictionary: {'action': action-name, 'arg_0': arg, ..., 'arg_N': argN} and serialize with pickle.
    • Deserialize by unpickling and decode with dictionary containing a mapping from action call to argument amount to resolve the correct number of arguments for an action call
  2. Create new Server class wrapping a ControlCenter which deserializes action calls received over tcp and dispatches to the control center. In case an action call returns data, the data has to be serialized and sent to the client the request came from. (Check results are interpreted as events, thus (like events received by the monitoring thread) they will be sent to all connected clients).

  3. Create new class deriving from manager.AbstractController named RemoteControllerInterface that connects to a running backend. 3.2 RemoteControllerInterface serializes action calls and sends them to the backend over tcp 3.3 RemoteControllerInterface listens for messages from the backend and interprets them by deserializing