【发布时间】:2014-05-02 02:47:33
【问题描述】:
我在 Dart 中发现了这种非常奇怪和不幸的行为。当我在主文件中导入“dart:html”时,我的 Isolate 停止工作。
使用我的文件“isolate.dart”:
main(){
print('BAM');
}
这会打印“BAM”:
import 'dart:core';
import 'dart:isolate';
void main() {
Isolate.spawnUri(Uri.parse('isolate.dart'), [], null);
}
但这什么也没打印:
import 'dart:core';
import 'dart:isolate';
import 'dart:html';
void main() {
Isolate.spawnUri(Uri.parse('isolate.dart'), [], null);
}
如何在使用 html 导入时让 Isolate 工作?
更新: 我找到了此代码https://github.com/TomCaserta/ExampleIsolate 并尝试使用它来查找问题。 Isolate 的 print() 调用似乎引起了问题。
【问题讨论】:
-
我按照承诺添加了链接。
标签: dart dart-isolates