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

refactor(cli): reorganize main.rs and split workers #8495

Merged
merged 6 commits into from
Nov 26, 2020

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Nov 25, 2020

Factored out init_v8_flags, init_logger and get_subcommand from main function.

Also Worker was removed in favor of moving logic to MainWorker and WebWorker
respectively.

Towards #8381

@bartlomieju bartlomieju requested a review from ry November 25, 2020 19:51
@bartlomieju bartlomieju changed the title refactor(cli): reorganize main.rs refactor(cli): reorganize main.rs and split workers Nov 25, 2020
}
DenoSubcommand::Types => {
let types = get_types(flags.unstable);
if let Err(e) = write_to_stdout_ignore_sigpipe(types.as_bytes()) {
eprintln!("{}", e);
std::process::exit(1);
}
return;
std::process::exit(0);
Copy link
Member

Choose a reason for hiding this comment

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

this fine for now, but ideally we would architect it so that exit is not called deeper inside the system

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, I'm still looking for proper patterns

cli/web_worker.rs Show resolved Hide resolved
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@bartlomieju bartlomieju merged commit 85a5a08 into denoland:master Nov 26, 2020
@bartlomieju bartlomieju deleted the reorg_main branch November 26, 2020 14:17
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