Releases: async-java/async.java
v0.2.6 — NeoRwLock (async reader/writer lock)
Highlights
- New:
NeoRwLock— async reader/writer lock alongsideNeoLock. Same callback-shape API, sameUnlockrelease token, FIFO across read/write modes with adjacent-reader bursting.
API
acquireRead(IAsyncCallback)/acquireWrite(IAsyncCallback)tryAcquireRead()/tryAcquireWrite()→Optional<Unlock>acquireRead(long timeoutMs, IAsyncCallback)/acquireWrite(long timeoutMs, IAsyncCallback)— bounded waitwithRead(Runnable)/withWrite(Runnable)— auto-release on throwreaderCount()/isWriteHeld()/queueDepth()— diagnostics
Fairness
FIFO with reader-burst. Queue [R1,R2,R3,W4,R5,R6] dispatches as (R1+R2+R3 concurrent) → W4 alone → (R5+R6 concurrent). Writers don't starve under bursty reads; readers don't starve under steady writes.
Not in v0.2.6
- Reader→writer upgrade and writer→reader downgrade (deferred to v0.2.7+)
- Reentrance — use
tryAcquireRead/Writefor defensive checks
Tests
14 new tests in NeoRwLockTest covering mutual exclusion under 500-task mixed load, reader-burst stress (50 readers wake concurrently), mixed-mode FIFO, writer FIFO, timeout cleanup, withRead/withWrite leak-safety on throw.
Total: 130 tests, 0 failures, 2 JDK 21-gated skips.
Maven (JitPack)
<dependency>
<groupId>com.github.async-java</groupId>
<artifactId>async.java</artifactId>
<version>v0.2.6</version>
</dependency>Full changelog: CHANGELOG.md.
v0.2.5 — ParallelLimit hardening + NeoLock audit + NeoQueue tests
ParallelLimit limit+1 dispatch fix; NeoLock new API (tryAcquire, acquire-with-timeout, withLock, isLocked, queueDepth, no-arg ctor); Waterfall c.success(k,v)/c.fail(e) shorthand; NeoQueue success/fail defaults; first functional tests for NeoQueue (9) and NeoLock (11). 116 tests, 0 failures. See CHANGELOG.md. JitPack: com.github.async-java:async.java:v0.2.5.
v0.2.4 — c.success() / c.fail() / WrapErrFirst + ArrayList resize-race fix
Highlights
c.success(v)andc.fail(e)default methods onIAsyncCallback— shorthands fordone(null, v)anddone(e, null). Cleaner call sites; fully additive.WrapErrFirst.wrap(...)adapter — wrap a value-only consumer into the canonical error-first callback and skip theif (err != null) ...preamble.cas the conventional continuation parameter name in all docs and examples.cis for continuation.- Fix:
ArrayListresize race inAsyncc.Parallel(List, callback). The old dispatch loop grew the result list one element at a time inside the task-submission loop; a fast-completing task could write to the in-progress-of-being-replaced backing array, silently losing its slot. Now pre-allocated and pre-filled before any task starts. Pinned byParallelResizeRaceTest. - JDK 17 floor (was 11). Consumers on JDK 11 should pin v0.2.3 (skipped) or v0.2.2.
- Substantial Javadoc rewrite on
Asyncc,NeoLock,NeoQueue, plus a newpackage-info.java. Replaces the deadcdn.rawgit.comscript tag with a real package overview, combinator catalogue table, error-handling notes, composition example, Loom integration snippet, and concurrency-contract summary.
Maven (via JitPack)
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.async-java</groupId>
<artifactId>async.java</artifactId>
<version>v0.2.4</version>
</dependency>Full changelog: CHANGELOG.md.