Skip to content

ABI: implement process nextTick scheduling #243

Description

@chrisbbreuer

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions