@praxisjs/concurrent
Changelog for @praxisjs/concurrent — @Task, @Queue, and @Pool for async concurrency control.
@praxisjs/concurrent
1.3.0
Opt-in AbortSignal support for @Task, @Queue, and @Pool.
Name the first parameter of your async method signal to receive a live AbortSignal. The decorator detects the parameter name and injects it automatically — callers are unaffected and methods without a signal parameter continue to work exactly as before.
async loadUser(signal: AbortSignal, id: number) {
return fetch(`/api/users/${id}`, { signal }).then(r => r.json())
}What changed per primitive:
@Task— each new invocation aborts the previous call's signal;cancelAll()also aborts the active signal.@Queue—clear()now also aborts the currently running call's signal in addition to cancelling pending items.@Pool— newcancelAll()method; aborts all active signals and resolves all pending calls asundefined.
AbortError is never stored in .error() — it is treated as intentional cancellation.
QueueClearedError is now exported from the package root: import { QueueClearedError } from '@praxisjs/concurrent'.
1.2.9
Updated dependencies — @praxisjs/[email protected], @praxisjs/[email protected].
1.2.8
Updated dependencies — @praxisjs/[email protected].
1.2.7
Updated dependencies — @praxisjs/[email protected].
1.2.6
Updated dependencies — @praxisjs/[email protected], @praxisjs/[email protected].
1.2.5
Updated dependencies — @praxisjs/[email protected], @praxisjs/[email protected].
1.2.4
Updated dependencies — @praxisjs/[email protected], @praxisjs/[email protected].
1.2.3
Updated dependencies — @praxisjs/[email protected], @praxisjs/[email protected].
1.2.2
Refreshed workspace dependencies for stability and security. Updated dependencies — @praxisjs/[email protected].
1.2.1
Updated dependencies — @praxisjs/[email protected], @praxisjs/[email protected].
1.2.0
@Task, @Queue, @Pool redesigned as field decorators.
Each decorator now goes on a separate field next to the async method, not on the method itself. The method name is the first argument. Reactive state is accessed as sub-properties with full TypeScript intellisense via TaskOf, QueueOf, PoolOf:
// before
@Task()
async loadUser(id: number) { ... }
// this.loadUser_loading() — no intellisense
// after
async loadUser(id: number) { ... }
@Task('loadUser')
taskLoadUser!: TaskOf<MyClass, 'loadUser'>
// this.taskLoadUser(1) ✓ — call it
// this.taskLoadUser.loading() ✓ — reactive boolean
// this.taskLoadUser.error() ✓ — reactive Error | null@Pool argument order changed
@Pool now takes the method name first, concurrency second: @Pool('method', 3) (was @Pool(3, 'method')).
1.0.0
Breaking — functional APIs removed
| Removed | Replacement |
|---|---|
task(method) | @Task('method') field decorator |
queue(method) | @Queue('method') field decorator |
pool(n, method) | @Pool('method', n) field decorator |
0.1.0
Initial beta release.