Skip to content
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

Open
wants to merge 1 commit into
base: spr/main/2ceebe3f
Choose a base branch
from
Open

Add request handling #1682

wants to merge 1 commit into from

Conversation

commit-id:723491f5

pub fn start_proc_macro_server(proc_macros: ProcMacroHost) -> Result<()> {
let connection = Connection::new();

//TODO
for i in 0..4 {
Copy link
Member

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 {
Copy link
Member

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)

Copy link
Member

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() {
Copy link
Member

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:

  1. extract worker body to a separate function
  2. extract request method routing to another one

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