Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Flask Microservice

Olaf Szmidt edited this page Sep 1, 2017 · 3 revisions

The full implementation of this service is found in the service.py. The resources exposed by the service are exposed through Socket.IO. The micro-service receives the base link from the creator and runs the service at that link. This link is passed in the environment as 'GAME_API_URL'. This link is exposed to the Kubernetes cluster through a reverse proxy.

Other resources can be added for testing but they should not be exposed via the reverse proxy. This approach is used in the our integration tests -- yet to be merged #222.

The communication protocol looks something like this:

 > server: world_init
 > client: client-ready, id
 > server: broadcast world-update for each state
 > client: filter my updates(i.e. only the ones for my id)

The communication between the 2 sides is carried through the JSON format. The API is detailed inside the WorldState class from the file simulation/world_state.py. A short description of the World State class can be found here.

Clone this wiki locally