Skip to content
Daan van Berkel edited this page Oct 28, 2021 · 3 revisions

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

Technology

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.

brain

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.

clock

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.

heartbeat

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.

serving

We use Iron to serve the client and respond to the registeration requests.

simulation

Simulation is the central process around which all other process are organized. It is responsible for coordinating the team flocks and advancing the simulation.

websockets

The websocket process is responsible with updating the client.

Clone this wiki locally