Skip to content

Releases: async-java/async.java

v0.2.6 — NeoRwLock (async reader/writer lock)

17 May 22:37

Choose a tag to compare

Highlights

  • New: NeoRwLock — async reader/writer lock alongside NeoLock. Same callback-shape API, same Unlock release 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 wait
  • withRead(Runnable) / withWrite(Runnable) — auto-release on throw
  • readerCount() / 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/Write for 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

17 May 22:11

Choose a tag to compare

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

17 May 21:28

Choose a tag to compare

Highlights

  • c.success(v) and c.fail(e) default methods on IAsyncCallback — shorthands for done(null, v) and done(e, null). Cleaner call sites; fully additive.
  • WrapErrFirst.wrap(...) adapter — wrap a value-only consumer into the canonical error-first callback and skip the if (err != null) ... preamble.
  • c as the conventional continuation parameter name in all docs and examples. c is for continuation.
  • Fix: ArrayList resize race in Asyncc.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 by ParallelResizeRaceTest.
  • 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 new package-info.java. Replaces the dead cdn.rawgit.com script 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.