Repository navigation
v0.18.0
Queuert 0.18 can run synchronously inside your driver's own transaction. It adds experimental MySQL/MariaDB and Redis state adapters, a broker-free IPC notify adapter and a public migrator for your own migrations. Schema fencing protects state across upgrades, and the release reworks tx hooks, the worker runner, job type codecs and adapter conformance, with breaking API changes and a Node.js 24 minimum.
What's Changed
Breaking Changes
- Node.js 24 or later is required. Every package's
engines.nodeis now>=24. - Factories are synchronous. A client, worker runner or adapter factory returns its value directly instead of a promise, so you can build them at module top level. An existing
awaiton the result keeps working. createInProcessWorker→createWorkerRunner(andInProcessWorker→WorkerRunner). The runner gainsstop(),close()and[Symbol.asyncDispose], andstart()no longer returns a stop function.- Transaction hooks are now tx hooks.
transactionHooksis renamed totxHooks, and the keyed hook registry is removed. The newtxHooks.retryBoundarysupports drivers that rerun the transaction callback, such as MongoDB'ssession.withTransaction. - State providers own commit and rollback callbacks. Custom providers must implement
onTransactionCommitandonTransactionRollback.txHooksis no longer an option oncompleteor on the client's mutating methods, andcompletesucceeds once per attempt. - Job type codecs replace
parseInput/parseOutput.encodeInput,decodeInput,encodeOutputanddecodeOutputrun on every write and read, so aDatewritten through a schema comes back as aDate. Encoded values must be JSON-serializable: a value that used to be coerced silently now throwsJobTypeValidationError, anddefineJobTypesenforces this at compile time. - Adapters are disposable and typed by mode.
StateAdapterandNotifyAdaptertake a"sync"or"async"mode type parameter and must implement disposal, so you can hold them withawait using. - In-process adapters default to synchronous mode. They return the adapter directly, and
InProcessContextis removed. - A client created without
notifyAdapternow uses an in-process notify adapter. Its own worker runners andawaitChaincalls are woken immediately, without polling. - Conformance suites are case lists. Run them with your own test runner, one test per case. The lists are layered into base, concurrent, async-only and end-to-end. The
run*Conformancerunners, their fixtures and theExpecttype are removed, and theState*types moved fromqueuert/internaltoqueuert. - Schema fencing (PostgreSQL, SQLite). Code running against a newer schema now fails with
SchemaFencedErrorinstead of corrupting state. Migration history is squashed into001_schema_v1, and 0.17 migration records are kept on upgrade. Stop every 0.17 process before running the next fenced migration. classifyErroris required on PostgreSQL and SQLite state providers.truncate()is removed fromPgStateAdapterandSqliteStateAdapter.- Pre-0.17 compatibility is dropped. Worker runners no longer reschedule running jobs that hold no attempt token, and
listWorkerJobsno longer acceptsworkerId: null. - SQLite type parameters changed on
createSqliteStateAdapterandcreateSqliteMigrator. - Dashboard API: the frontend talks to its server through a single
POST {basePath}/api/rpcendpoint. It replaces/api/chains,/api/jobsand/api/workers.
Features
- Synchronous mode. With a SQLite driver that runs statements synchronously, you can call Queuert inside the driver's own synchronous transaction, such as
db.transaction(() => …)(). The client follows its state adapter's mode, and SQLite gains synchronous providers and aMigrator<"sync">. @queuert/mysql(experimental): a MySQL 8.4+ / MariaDB 11.4+ state adapter, with a migrator and conformance entries.- Redis state adapter (experimental):
createRedisStateAdapterkeeps chains, jobs and workers in Redis, standalone or Cluster. @queuert/ipc(experimental): a notify adapter over Unix sockets or named pipes, for multi-process apps on one host without a broker.- Public migrator (experimental):
createPgMigrator,createSqliteMigratorandcreateMysqlMigratorrun your application's own migrations with the same engine as Queuert's schema (#8). - Chain tail jobs (experimental):
getChainTailJobandgetChainTailJobsread the job each chain is currently on, for a whole batch of chains in a single read (#9). - Conformance with your adapter configuration: the state provider conformance helpers accept
stateAdapterOptions. - Browser support:
queuertno longer depends on Node.js built-ins, so the client, worker runner and in-process adapters also run in browsers and service workers. - Dashboard: the theme follows a change made in another tab, the favicon adapts to dark mode, the dashboard works under a CSP without
unsafe-eval, and it accepts a client in either mode.
Improvements
- Faster job processing: each job uses about 35–40% less CPU and allocates less memory.
- PostgreSQL providers open transactions at READ COMMITTED explicitly, so a higher server or role default can't change Queuert's own transactions.
- SQLite takes its write lock through a no-op write to the
{prefix}write_locktable, the same way migrations do. - Clearer stack traces: functions that run in both modes carry their real names in stack traces and CPU profiles. A synchronous client given a callback that returns a promise reports that clearly.
- Stability:
@queuert/sqliteand@queuert/dashboardare now marked stable.
Bug Fixes
- When deduplication matches a
createChain/createChainscall to an existing multi-step chain, the call now returns that chain's real output. - A notify adapter whose unsubscribe fails no longer interrupts the worker or
awaitChain; the error is logged instead. - Deletes (
deleteChains, stopping a worker) are fenced like other writes.
Packages
All packages released at 0.18.0: queuert, @queuert/postgres, @queuert/sqlite, @queuert/mysql, @queuert/redis, @queuert/nats, @queuert/ipc, @queuert/otel, @queuert/dashboard. @queuert/mysql and @queuert/ipc are published for the first time.