This demo uses the following Temporal SDKs:
This demo shows how Temporal can be used to orchestrate multiple polyglot services responsible for different parts of a snake game.
git clone https://github.com/temporalio/docker-compose.git
cd docker-compose
docker compose up
The Game Controller Service is a Java App that uses the Temporal Java SDK
cd game-controller
mvn compile exec:java -Dexec.mainClass="io.temporal.snakegame.controller.ControllerStarter"
The Game Info Service is a Go App that uses the Temporal Go SDK
cd game-info
go run worker/main.go
The Game Movement Rules Services is a PHP App that uses the Temporal PHP SDK
cd game-rules
./rr serve
The Snake game is a Java app which uses the three started services for overall game control, game info such as images, text, fonts background, etc as well as movement controls.
cd game
mvn compile exec:java -Dexec.mainClass="io.temporal.snakegame.SnakeGameStarter"
Once the game starts you can use your keyboard LEFT RIGHT UP DOWN keys to move the snake across the board. The goal is to eat the apples. Once you eat an apple your snake will increase and another apple icon will get displayed on the board. If you run into any of the edges of the board, or into your snake itself the game is over.