ForkJoinPool forkJoinPool = new ForkJoinPool(2);
forkJoinPool.submit(() ->
//parallel task here, for example
IntStream.range(1, 1_000_000).parallel().filter(PrimesPrint::isPrime).collect(toList())
).get();
Reactive streams are a unified way of dealing with asynchronous events in JavaScript. Learn more in this tutorial with RxJs examples that you can run & modify.
Q. Hart, and M. Gertz. GIS '06: Proceedings of the 14th annual ACM
international symposium on Advances in geographic
information systems, page 243--250. New York, NY, USA, ACM Press, (2006)
D. Kottke, G. Krempl, and M. Spiliopoulou. Advances in Intelligent Data Analysis XIV, volume 9385 of Lecture Notes in Computer Science, page 145-157. Springer International Publishing, (2015)