Code Monkey home page Code Monkey logo

reactrode's Introduction

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

  1. putting a null reference into a Flux (or Mono) results in a puzzling "circularity" exception
  2. why won't RSocket for Spring Messaging support e.g. Flux<String> return type or a String arg to a message mapping—primitive types aren't supported.
  3. 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

reactrode's People

Contributors

bill avatar

Stargazers

Michael Watts avatar Sergiy Tsimbalyuk avatar Víctor Martín Molina avatar Amit Vyas avatar  avatar Sergey Kryvets avatar

Watchers

 avatar James Cloos avatar Dick Cavender avatar

Forkers

haewons-tanzu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.