This is a porting of TypeSafe's Reactive Stock example to Quasar Actors and Comsat Web Actors. Run on Jetty embedded servlet container plus its WebSocket module.
./gradlew run
.- Open http://localhost:8080 in Firefox.
- Play with it.
- The Java implementation is almost as compact as the half-Scala original one.
- ...And much easier to understand.
- Quasar Actors are based on Quasar's lightweight threads or fibers which make all the code is code straightforward, sequential imperative style.
- No declarative-functional-monadic-async programming is forced down your throat just to work around JVM threads' heavy footprint.
- Since calls are (fiber-)blocking and full control flow language can be used around them, no tick message is needed: just use the straightfoward blocking
receive
with a timeout. - By default Web Actors automatically assign a new actor to a request or WebSocket connection, which can be configured for automatic termination upon connection closing with a simple
watch
call.- So, supervision isn't really necessary and Quasar doesn't make it mandatory (it is there just to showcase it).
- Actors and Web Actors do just one thing well: everything is conf- and JSON-library agnostic, you're not forced into a full-blown lock-in web framework.
- 100% Servlet compatible, no need to run a non-standard embedded server if you don't want to.
- Currently generated web resources are just copied: add build steps from original CoffeeScript and LESS source files.
- Do away with the
comsat-testutils
dep. - Add Capsule-based deployment.