This is a Conway's Game of Life simulation implemented in a reactive style using Project Reactor. I developed this code for my 2019 Apache Geode Summit Talk: Reactive Event Processing with Apache Geode.
The goal of the talk was to explore how Apache Geode fit into a reactive system. In the talk, and in this repository, you'll see how Geode fits into a distributed reactive system as an event producer, and as an event consumer. RSocket is used for network communication, and there's even a fun little browser-based visualizer based on Luca Sbardella's Gist.
Status
Gameserver produces allGenerations
flux which can be consumed by:
- browser-based, JavaScript react-app
- Java-based testclient app
- Java-based recorder app, which feeds geodeserver Geode server
Build and Run
Works with OpenJDK 12 from Oracle and Adopt OpenJDK 12.
TODO
- enable BlockHound https://github.com/reactor/BlockHound
- upgrade RSocket to 1.0.0-RC2 or newer
- side project: figure out how to make
Mono<Cell> put(final Mono<Cell> cellMono)
work analogously to its Flux counterpart - remove dependency on org.springframework.data:spring-data-commons in model module (necessary to make spring-data-geode serialization work)
Questions
- putting a null reference into a
Flux
(orMono
) results in a puzzling "circularity" exception - why won't RSocket for Spring Messaging support e.g.
Flux<String>
return type or aString
arg to a message mapping—primitive types aren't supported. - why must I my RSocket client app include a dependency on webflux to avoid crashing the RSocket server?
Run
To run just the reactive toy app: game server -> browser:
./gradlew :gameserver:bootRun
then, in another terminal:
cd react-app
npm start
After starting these in IntelliJ:
GeodeServerApplication -Xmx1g -Xms1g -Xss144k
GameServerApplication
RecorderApplication
use gfsh:
connect --locator=localhost[10334]
describe region --name=Cells