【Java】JavaでPromiseを使った非同期処理を記述したい ~ JavaScriptのPromiseライクな文法の試行~ 概要 Java言語で「JavaScriptのPromiseライクな文法で、非同期処理・並行処理を記述してみたい」と思いやってみました。 ソースは以下リポジトリにあります https://github.com/riversun/java-promise コード例 「非同期処理1が終わったら、その結果を使った非同期処理2が実行される」処理はJavaではどのように書けば良いでしょうか? 解1:Java1.4時代の解:Threadクラスの機能でがんばる Threadを入れ子式に持つとか、joinで終了待ちとか。並列処理黎明期。 解2:Java5(1.5)時代の解:Callable/Futureで幸せになれたのかな・・・ Future/Callableで結果返せてうれしい