-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add op_id throughout op API #2734
Conversation
Removes the magic number hack to switch between flatbuffers and the minimal dispatcher. Adds machinery to pass the op_id through the shared_queue.
I don't really understand what the purpose of moving the op_id out of the control buffer while leaving the other fields, (e.g. promise_id) in there. |
Is this prep for dynamic op dispatching? |
@piscisaureus having the op_id put allows us to route to dispatcher - the control buffer contains all the parameters of the various ops - which is not something generally applicable to ops. Like the filename parameter of Deno.stat shouldn’t be visible to Isolate::poll. The name "controlBuf" is probably confusing - it should be called "paramsBuf".
|
@afinch7 In part, yes. This allows each op to choose its own serialization mechanism. Something the read/write ops do currently through a very terrible hack: Line 6 in 43d099c
In general this patch is a series of updates to the Op API outlined in #2730 |
core/isolate.rs
Outdated
@@ -283,10 +287,12 @@ impl Isolate { | |||
// return value. | |||
// TODO(ry) check that if JSError thrown during respond(), that it will be | |||
// picked up. | |||
let _ = isolate.respond(Some(&buf)); | |||
let op_id = 0; // Sync messages ignore op_id. | |||
let _ = isolate.respond(Some((op_id, &buf))); |
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.
Maybe panic here if respond() errors?
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.
done
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.
LGTM
Ref #2730