Skip to content

Commit 734a2a1

Browse files
committed
Add worker_threads interop file and implementation
Something here is not working 100%, on running render `ParentPort` is null and it should be an object if its on the worker thread.
1 parent 6da5630 commit 734a2a1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/src/node.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ Future<RenderResult> _renderAsync(RenderOptions options) async {
8080
var start = DateTime.now();
8181
var file = options.file == null ? null : p.absolute(options.file);
8282
CompileResult result;
83-
8483
if (isMainThread == true) {
8584
print("Creating worker thread");
8685
final worker = Worker(p.current, WorkerOptions(workerData: {options}));

lib/src/node/worker_threads.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Copyright 2020 Google Inc. Use of this source code is governed by an
22
// MIT-style license that can be found in the LICENSE file or at
33
// https://opensource.org/licenses/MIT.
4+
@JS()
5+
library worker_threads;
6+
47
import 'package:js/js.dart';
58

69
@JS("worker_threads")

0 commit comments

Comments
 (0)