Skip to content

docs(claude): describe the threading model and client architecture - #3385

Closed
Yury Semikhatsky (yury-s) wants to merge 2 commits into
mainfrom
docs-claude-md-architecture
Closed

Yury Semikhatsky (yury-s) wants to merge 2 commits into
mainfrom
docs-claude-md-architecture

Conversation

@yury-s

@yury-s Yury Semikhatsky (yury-s) commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Core/ mirrors packages/playwright-core/src/client/ method for method; which files are generated and by what.
  • Threading model: incoming messages are handled one at a time in protocol order; events before a reply are fully handled before the awaiting code resumes, events after it race with that code; replies continue on the thread pool, while event-driven waits (Waiter) resume inline on the reader thread. Consequences for changes: subscribe before checking, no lock, don't block after an event-driven wait, event subscriptions that send updateSubscription, NoInlining on public API methods.
  • Where regression tests go, how to run one class, how the test adapters are structured and tested.

Written up from the review of #3384 and verified with probe tests on chromium.

Document that Core/ mirrors the JS client method for method, how messages
are dispatched on the transport reader thread while user continuations run
on the thread pool, and what that means for changes: subscribe before
checking, no locks, event subscriptions that talk to the server, NoInlining
on public API methods. Also where regression tests go, how the test
adapters are structured and how they are tested.
Incoming messages are handled one at a time, so an event that precedes
a reply is fully handled before the awaiting code resumes, while events
after the reply race with it. Waits that complete through an event
resume inline on the reader thread.
@dgozman

Copy link
Copy Markdown
Collaborator

Closing in favor of #3453.

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.

2 participants