-
Notifications
You must be signed in to change notification settings - Fork 1
Server
This page documents the server. The documentation on the client is found elsewhere.
The server is responsible for the bread and butter of the workshop. That includes
- brain
- clock
- heartbeat
- serving
- simulation
- websockets
below we will describe all these responsibilities
The server is written in Rust.
Each responsibility has a corresponding module in the server and it's own thread. Threads communicate with each others via channels. If a thread receives messages, those messages are defined in a corresponding communication module.
The brain is responsible for requesting intent of each boid in the flock of each team. It will start when it receives a Pick message that contains all the brain server urls to request intent from.
For each response of intent it will send a brain update message to the simulation.
The clock is responsible for keeping track of time. It is mainly used to advance the simulation by sending it a Tick message.
The interval in milliseconds between ticks is read from an environment variable tick.
Brain servers are actively developed and are started and stopped over the live-time of the workshop server. The hearbeat module will check the heartbeat of each team upon receiving a Check message.
The results of the heartbeat check are communicated with a HeartBeatStatus message.
We use Iron to serve the client and respond to the registeration requests.
Simulation is the central process around which all other process are organized. It is responsible for coordinating the team flocks and advancing the simulation.
The websocket process is responsible with updating the client.