Releases: ueberBrot/monque
@monque/tsed@1.5.1
@monque/tsed@1.5.0
@monque/core@1.7.0
Minor Changes
-
#249
2c7c079Thanks @ueberBrot! - Add deprecation console warning fordefaultConcurrencyandmaxConcurrencyoptions. -
#260
c11798bThanks @ueberBrot! - Parallelized job acquisition in the poll loop usingPromise.allSettledto lower wall-clock acquisition latency / reduce serialized DB waits (fans out onefindOneAndUpdateper free slot).
Patch Changes
-
#269
cb707b9Thanks @ueberBrot! - Validate job names and unique keys at the public API boundary so invalid identifiers fail fast before reaching MongoDB operations. -
#266
9c75d1cThanks @ueberBrot! - Fix.then()to.finally()inexecutePollAndScheduleNextto ensure the next poll is always scheduled, even ifscheduleNextPollthrows. This prevents silently swallowed rejections when the callback in.then()throws. -
#258
218d398Thanks @ueberBrot! - ReplacegetActiveJobs()array allocation withgetActiveJobCount()in shutdown path. The previous implementation created a throw-awaystring[]on every call just to check.length. The new method returns a count directly usingMap.size, avoiding unnecessary array allocations during shutdown polling. -
#259
b0babc4Thanks @ueberBrot! - Replace the O(workers) iteration ingetTotalActiveJobs()with an O(1) counter that updates on job acquisition and completion. -
#263
a30186fThanks @ueberBrot! - Add compound index for job retention to avoid collection scan during cleanup -
#264
c2b046eThanks @ueberBrot! - Deduplicatenew Date()calls in update operations. Instead of creating multiplenew Date()instances milliseconds apart within the same logical operation, methods likecancelJob,retryJob, andcompleteJobnow capture a singleconst now = new Date()and reuse it for all timestamp fields, ensuring consistent timestamps. -
#265
79300c0Thanks @ueberBrot! - OptimizecancelJob,retryJob, andrescheduleJobby removing redundantfindOnepre-checks. These operations now use an optimisticfindOneAndUpdatefirst, reducing database round-trips for the common happy paths. -
#262
1b6e29fThanks @ueberBrot! - Removed redundant$unsetoperations forheartbeatIntervalon job completion/failure to improve performance and retain observability metadata. -
#257
d71049dThanks @ueberBrot! - Replace thesetInterval(100)busy-loop instop()with a reactive drain promise that resolves instantly when all active jobs finish. -
#267
965f8aaThanks @ueberBrot! - Set maxListeners to 20 on Monque EventEmitter to prevent memory leaks in long-running processes.
@monque/tsed@1.4.3
@monque/core@1.6.0
Minor Changes
-
#232
c3d2c83Thanks @ueberBrot! - Add adaptive poll scheduling and targeted change stream processing- Adaptive polling: When change streams are active, safety polling runs at
safetyPollInterval(default 30s) instead of the fastpollInterval. Falls back topollIntervalwhen change streams are unavailable. - Targeted polling: Change stream events now leverage the full document to poll only the specific worker(s) for the affected job type, skipping unrelated workers.
- Wakeup timers: Future-dated jobs (
nextRunAt > now) get a precise wakeup timer instead of waiting for the next poll cycle. - Local pending-job notifications: Jobs created or moved back to
pendingby the local scheduler now trigger the same targeted polling and wakeup-timer path immediately, avoiding startup races before the change stream cursor is fully ready. - Slot-freed re-polling: When a job completes or permanently fails, a targeted re-poll immediately picks up the next waiting job for that worker.
- Re-poll queuing: Poll requests arriving while a poll is running are queued and executed after, preventing silently dropped change-stream-triggered polls.
- New configuration option:
safetyPollInterval(default: 30000ms).
- Adaptive polling: When change streams are active, safety polling runs at
@monque/tsed@1.4.2
@monque/core@1.5.2
Patch Changes
- #227
e9208caThanks @ueberBrot! - Prevent change stream reconnection attempts from running after the scheduler stops. This clears pending reconnect timers during shutdown and adds coverage for the stop-during-backoff scenario.
@monque/tsed@1.4.1
@monque/core@1.5.1
Patch Changes
- #211
7181215Thanks @ueberBrot! - Close shutdown race condition window by stopping timers before setting isRunning flag