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

dev(compiler): add actor for watch compiler #371

Merged
merged 18 commits into from
Sep 27, 2023
Merged

Conversation

Myriad-Dreamin
Copy link
Owner

No description provided.

@Myriad-Dreamin Myriad-Dreamin merged commit a30cad9 into main Sep 27, 2023
@Myriad-Dreamin Myriad-Dreamin deleted the watch-compiler-actor branch September 27, 2023 08:05
compiler/src/service/compile.rs Show resolved Hide resolved
compiler/src/service/compile.rs Show resolved Hide resolved
// Accumulate events.
let mut need_recompile = false;
need_recompile = self.process(event, &compiler_ack) || need_recompile;
while let Some(event) = fs_rx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd prefer breaking nested code here into 3 whiles. But... it's not my code so do it as you wish

let TaggedMemoryEvent {
logical_tick,
event,
} = *event.downcast().unwrap();
Copy link
Collaborator

@Enter-tainer Enter-tainer Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downcast().unwrap()? seems that u r pretty sure what the underlying type is. It is possible to make it static? box<dyn any> is super ugly

steal_send: mpsc::UnboundedSender<BorrowTask<Ctx>>,
memory_send: mpsc::UnboundedSender<MemoryEvent>,

_ctx: std::marker::PhantomData<Ctx>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this for

compiler/src/service/compile.rs Show resolved Hide resolved
compiler/src/service/driver.rs Show resolved Hide resolved
}

/// Update the watches of corresponding files.
fn update_watches(&mut self, paths: &[ImmutPath]) -> Option<FileChangeSet> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand why unwatch + rewatch works? What problem does it solve?

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