Skip to content

Commit 179cc40

Browse files
committed
+ doc
1 parent 0efa144 commit 179cc40

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ keys now assigned to the same bucket/executor may delay each other's execution i
136136
executor's task queue. Consider this a trade-off of the executor's having the same syntax and semantic richness as a
137137
JDK [ExecutorService](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html).
138138

139-
To account for hash collision, conseq4j does not support any shutdown action on the API-provided
139+
To account for hash collision, conseq4j Style 1 does not support any shutdown action on the API-provided
140140
executor ([ExecutorService](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html))
141141
instance. That is to prevent unintended task cancellation across different sequence keys.
142142
The [Future](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html) instance(s) subsequently
@@ -188,8 +188,10 @@ This API style is more concise. Bypassing the JDK ExecutorService API, it servic
188188
execution semantics holds: Tasks of the same sequence key are executed in the same submission order; tasks of different
189189
sequence keys are managed to execute in parallel.
190190

191-
By making use of Java 21 virtual threads, the style default to have no preset limit on the overall concurrency when
192-
executing tasks. Prefer this style when the full-blown syntax and semantic support of
191+
For versions requiring Java 21+, conseq4j Style 2 defaults to have no preset limit on the overall concurrency when
192+
executing tasks; for other versions, this style's default concurrency is the number of JVM run-time'
193+
s [availableProcessors](https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#availableProcessors--). Prefer
194+
this style when the full-blown syntax and semantic support of
193195
JDK [ExecutorService](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html) is not
194196
required.
195197

@@ -234,20 +236,21 @@ by unrelated tasks of different sequence keys in the same "bucket" - as is unnec
234236
advantage over the thread-affinity API style, at the trade-off of lesser syntax and semantic richness than the
235237
JDK [ExecutorService](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html).
236238

237-
The default ConseqExecutor instance uses virtual thread per task, and has no preset limit on overall concurrency.
239+
For versions requiring Java 21+, the default ConseqExecutor instance uses Virtual thread per task, and has no preset
240+
limit on overall concurrency. For other versions, the default concurrency is the number of JVM's available processors.
238241

239242
```jshelllanguage
240243
ConseqExecutor.instance()
241244
```
242245

243-
Or, the concurrency/parallelism can be customized to use a platform thread `ForkJoinPool` of the specified capacity:
246+
The concurrency/parallelism can be customized to use a Platform thread `ForkJoinPool` of the specified capacity:
244247

245248
```jshelllanguage
246249
ConseqExecutor.instance(10)
247250
```
248251

249-
The `ConseqExecutor` instance can also use a fully-customized `ExecutorService` to power its async operations, e.g.
250-
with a fixed sized platform-thread pool:
252+
The `ConseqExecutor` instance can also use a fully-customized (Virtual or Platform thread-based) `ExecutorService` to
253+
power its async operations, e.g. with a fixed sized platform-thread pool:
251254

252255
```jshelllanguage
253256
ConseqExecutor.instance(Executors.newFixedThreadPool(10))

0 commit comments

Comments
 (0)