tree: 9e843e7a220d2ba2099c4e4b9e6a759645572472 [path history] [tgz]
  1. go/
  2. images/
  3. Makefile
  4. README.md
machine/README.md

Machine Server

The machine state server is a centralized management application for device testing.

See the Design Doc.

Code structure

The main code is structure as:

go/machine/
    source/
    processor/
    store/

Where:

  • types contains the Go types used across the rest of the modules.
  • The source module contains source.Source, a way to get update events from machines.
  • The store module contains store.Store, a way to persist and retrieve each machines state.
  • The processor module contains processor.Processor, a way to update a machine state from an incoming event.

The main loop of machine state server looks like:

for event := range aSource {
   machineID := idFromEvent(event)
   currentDescription := aStore.Get(machineID)
   newDescription = aProcessor.Process(event, currentDescription)
   aStore.Put(machineID, newDescription)
}