This repository contains both my experimentation of the OpenJDK project Loom prototype and a presentation and examples showing how to use it.
There is a presentation of the loom project wiht the examples.
Download the latest early access build of jdk-20 http://jdk.java.net/ set the environment variable JAVA_HOME to point to that JDK and then use Maven.
export JAVA_HOME=/path/to/jdk
mvn package
On top of each example, there is the command line to run it.
- Loom is a preview version so
--enable-previewis required, - For
ScopeLocalandStructuredTaskScope, these are not yet part of the official API and are declared in module/packagejdk.incubator.concurrentso this module has to be added to the command line with--add-modules jdk.incubator.concurrent, - If you want to play with the internals, the class
Continuationis hidden thus--add-exports java.base/jdk.internal.vm=ALL-UNNAMEDshould be added to the command line.
This repository also contains a high-level structured concurrency construct named
src/main/java/fr/umlv/loom/structured/AsyncScope.java that is a proposed replacement
to the more low level StructuredTaskScope currently provided by the OpenJDK loom repository.
At some point of the history, this project was containing an actor system based on loom. It has now its own repository https://github.com/forax/loom-actor.
There is a re-implementation of the expressjs API in Java using Loom JExpressLoom.java.