Skip to content

Commit fd74031

Browse files
committed
Add a comment for gracefulShutdown
1 parent 3d8b4f0 commit fd74031

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/src/embedded/vm/executable.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ import '../worker_dispatcher.dart';
1212

1313
void main(List<String> args) {
1414
if (parseOptions(args)) {
15+
// The option `gracefulShutdown: false` means exit the process immediately
16+
// without waiting for child isolates to shutdown. Dart VM does not need to
17+
// wait as it does not have race condition issues between communication and
18+
// worker shutdown in NodeJS.
19+
//
20+
// Because `gracefulShutdown` only gracefully terminates the worker that it
21+
// does not wait for inflight requests to finish, there is no behavior
22+
// difference to the end users.
1523
WorkerDispatcher(
1624
StreamChannel.withGuarantees(stdin, stdout, allowSinkErrors: false)
1725
.transform(lengthDelimited),

0 commit comments

Comments
 (0)