【问题标题】:Dart : Isolate not working when using html importDart:使用 html 导入时隔离不起作用
【发布时间】: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


【解决方案1】:

这是已知的错误/限制。正在处理中。

目前无法在隔离中访问 'dart:html' 包的功能,并且 'print()' 使隔离崩溃可能是因为没有可重定向命令的具有“打印”功能的包到。

Dart 问题跟踪器目前似乎不可用。
我稍后再试以添加一些参考。

我认为相关的一些未解决的问题:

【讨论】:

    猜你喜欢
    • 2015-01-06
    • 1970-01-01
    • 1970-01-01
    • 2018-09-15
    • 2014-03-06
    • 1970-01-01
    • 1970-01-01
    • 2022-11-10
    • 2015-01-29
    相关资源
    最近更新 更多