-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiplex Workers documentation #10108
Conversation
I'm turfing this to @philwo because he should be a better reviewer for this than I would be. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
site/docs/multiplex-worker.md
Outdated
|
||
## A Guide to Write a Multiplex-Compatible Ruleset | ||
|
||
The rule's worker process should be multi-threaded to take advantage of Multiplex Workers. Protobuf allows a ruleset to parse a single request even though there might be multiple requests piling up in the stream. Whenever the worker process parses a request from the stream, it should handle the request in a new thread. Since different thread could complete and write to the stream at the same time, the ruleset needs to make sure the responses are written atomically (i.e. messages don't overlap). Responses must contain the `request_id` of the request they're handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would replace "the ruleset needs to make sure" with "the worker process needs to make sure" (because this locking as to be implemented in the worker process, not in the Starlark rules).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@philwo friendly ping here. Would you be able to take another look? |
Sorry @borkaehw! Merging this now. |
Thanks @philwo. How can we wire it up so people can read it in webpage form? |
Never mind, it seems to be automatic. |
A documentation for Multiplex Workers. See the original PR for details. #6857
Fix: #2832