hakdogan / scoped-values

The Scoped Values API allows us to store and share data for a bounded lifetime. This repository shows how you can use it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scoped Values

The Scoped Values API allows us to store and share immutable data for a bounded lifetime. It has been included in the JDK since Java 20 as an incubator API. This repository shows how you can use it with Virtual Threads and Structured Concurrency.

Requirement

JDK 20 or later

Ho to compile?

mvn clean install
jar cmf ./META-INF/MANIFEST.FM scoped-values.jar -C ./target/classes/ .

or

sh ./compile.sh   

Ho to run?

java --enable-preview --add-modules jdk.incubator.concurrent -jar scoped-values.jar

or

sh ./run.sh   

Relevant article is

An introduction to Scoped Values in Java

About

The Scoped Values API allows us to store and share data for a bounded lifetime. This repository shows how you can use it.


Languages

Language:Java 97.1%Language:Shell 2.9%