-
Notifications
You must be signed in to change notification settings - Fork 69
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 request handling #1682
base: spr/main/2ceebe3f
Are you sure you want to change the base?
Add request handling #1682
Conversation
commit-id:723491f5
|
||
pub fn start_proc_macro_server(proc_macros: ProcMacroHost) -> Result<()> { | ||
let connection = Connection::new(); | ||
|
||
//TODO | ||
for i in 0..4 { |
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.
use std::thread:available_parallelism
. do not hardcode threading amounts
use serde::Serialize; | ||
|
||
#[derive(Serialize)] | ||
pub struct ErrResponse { |
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.
this should probably reside in proc-macros-server-api crate. I made a related comment about this in that PR: #1678 (comment)
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.
please start adding tests for this system starting with this PR
.name(format!("proc-macro-server-worker-thread-{i}")) | ||
.spawn(move || { | ||
for request in receiver { | ||
let response = match request.method.as_str() { |
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.
the indentation is going crazy here, please:
- extract worker body to a separate function
- extract request method routing to another one
Stack:
ExpandInline
handler #1686ExpandDerive
handler #1685ExpandAttribute
handler #1684DefinedMacros
handler #1683ProcMacroHost
#1680proc-macro-server
command #1679cairo-lang-macro
fix null-byte panics #1677cairo-lang-macro
#1676