Skip to content

DOC: document Context#perform_microtask_checkpoint#419

Merged
SamSaffron merged 1 commit into
rubyjs:mainfrom
ursm:readme-perform-microtask-checkpoint
May 28, 2026
Merged

DOC: document Context#perform_microtask_checkpoint#419
SamSaffron merged 1 commit into
rubyjs:mainfrom
ursm:readme-perform-microtask-checkpoint

Conversation

@ursm
Copy link
Copy Markdown
Contributor

@ursm ursm commented May 28, 2026

Follow-up to #418 as requested.

Adds a Microtask checkpoints subsection to the README:

  • Explains V8's default auto-drain (Promise.resolve().then(...) "just works" for simple scripts).
  • Documents Context#perform_microtask_checkpoint and when you actually need it — the synchronous-Ruby-callback case (e.g. chained dispatchEvent listeners running in one context.call).
  • Both code samples were run through mini_racer locally; outputs in the comments are real.

Placed after Function call, before Performance, matching the existing flat h3-section pattern in that area. Kept the section short given your note about README size.

🤖 Generated with Claude Code

Adds a "Microtask checkpoints" section explaining V8's auto-drain
behavior and when manual draining is needed (Ruby callbacks invoked
synchronously from JS, e.g. chained dispatchEvent listeners).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@SamSaffron
Copy link
Copy Markdown
Collaborator

CI failure is strange, it just skipped 3 specs ... not exit 1 worthy.

@SamSaffron SamSaffron merged commit e43d75d into rubyjs:main May 28, 2026
41 of 47 checks passed
@ursm ursm deleted the readme-perform-microtask-checkpoint branch May 28, 2026 03:32
@tisba
Copy link
Copy Markdown
Collaborator

tisba commented May 28, 2026

@SamSaffron in #417 I noticed that Ruby 3.1 consistently seems to hang in CI. The other failures are more intermittent and might also be some Github issues? 🤷

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants