Parent: #140
Related: #134, #163, #164, #239
Implement the two shared private-ABI next-tick entry points on a real realm-owned process queue rather than aliasing them to ordinary Promise jobs.
Scope
Bun__Process__queueNextTick1
Bun__Process__queueNextTick2
- the directly required
process.nextTick queue and checkpoint integration
Acceptance
- Preserve exact one-argument versus two-argument callback arity, encoded value identity, FIFO order,
this behavior, and selected-realm ownership.
- Drain all next-tick work before Promise microtasks at a host checkpoint; after microtasks, loop when they queued more next-tick work, matching the pinned process queue algorithm.
- Support reentrant scheduling without front-shifts or duplicate execution, and stop accepting work once
process._exiting is true.
- Validate callbacks and publish abrupt completion through the existing first-pending exception boundary; callback failures must use the process uncaught-exception path without losing remaining rooted jobs.
- Preserve sibling-realm isolation, reject foreign-VM values, trace every queued function/argument precisely, and remain correct for worker-local microtask queues.
- Add focused runtime and consumer fixtures, update both inventories and README/API/ABI integration evidence, and report committed verification to the parent issues.
Bun__runDeferredWork remains separate: its opaque scheduler task pointer and lifetime contract are not the process next-tick queue.
Parent: #140
Related: #134, #163, #164, #239
Implement the two shared private-ABI next-tick entry points on a real realm-owned process queue rather than aliasing them to ordinary Promise jobs.
Scope
Bun__Process__queueNextTick1Bun__Process__queueNextTick2process.nextTickqueue and checkpoint integrationAcceptance
thisbehavior, and selected-realm ownership.process._exitingis true.Bun__runDeferredWorkremains separate: its opaque scheduler task pointer and lifetime contract are not the process next-tick queue.