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

Run cli compilations in parallel dart isolates #2078

Merged
merged 9 commits into from
Sep 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion lib/src/io/vm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,24 @@ bool get supportsAnsiEscapes {
return io.stdout.supportsAnsiEscapes;
}

void print(Object? message) {
ntkme marked this conversation as resolved.
Show resolved Hide resolved
_threadSafeWriteLn(io.stdout, message);
}

void printError(Object? message) {
io.stderr.writeln(message);
_threadSafeWriteLn(io.stderr, message);
}

void _threadSafeWriteLn(io.IOSink sink, Object? message) {
// For better performance the buffer is mutated.
if (message is StringBuffer) {
message.writeln();
sink.write(message);
ntkme marked this conversation as resolved.
Show resolved Hide resolved
} else {
var buffer = StringBuffer(message.toString());
buffer.writeln();
sink.write(buffer);
}
}

String readFile(String path) {
Expand Down