Skip to content

isolate in dartium not creating httprequest, works when compiled to javascript #16565

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

Closed
DartBot opened this issue Feb 5, 2014 · 5 comments
Closed
Labels
closed-duplicate Closed in favor of an existing report library-isolate

Comments

@DartBot
Copy link

DartBot commented Feb 5, 2014

This issue was originally filed by [email protected]


What steps will reproduce the problem?

  1. create a file with a method to access data using httprequest and a main method
  2. import this file as a web-worker using Isolate.spawnURI

What is the expected output? What do you see instead?
I'd expect the isolate to fire an httprequest. In dartium this doesn't happen. When I compile the code to javascript it runs fine. the http request is sent and the data is fetched.

What version of the product are you using? On what operating system?
Dart Editor version 1.2.0.dev_03_02 (DEV)
Dart SDK version 1.2.0-dev.3.2

Ubuntu 12.04

Many thanks!

minimal code:

in main.dart:

import 'dart:html';
import 'dart:isolate';

SendPort sendPort;
void main() {
  ReceivePort receivePort = new ReceivePort();
  Isolate.spawnUri(Uri.parse("worker.dart"), null, receivePort.sendPort);

  receivePort.listen((var m) {
    print(m);
    if(sendPort==null) {
      sendPort=m;
    } else {
      print(m);
    }
  });
}

in worker.dart:

import "dart:isolate";

ReceivePort receivePort;

void main(List<String> args, SendPort sp) {
  receivePort = new ReceivePort();
  sp.send(receivePort.sendPort);
  sp.send("this string arrives");
  HttpRequest.getString(COMPLETE_URL)
      .then((String string)=>sp.send("this string doesn't arrive");
}

@lrhn
Copy link
Member

lrhn commented Feb 6, 2014

Added Area-Dartium, Library-Isolate, Triaged labels.

@a-siva
Copy link
Contributor

a-siva commented Feb 7, 2014

What is COMPLETE_URL in your test case?


Added NeedsInfo label.

@DartBot
Copy link
Author

DartBot commented Apr 11, 2014

This comment was originally written by [email protected]


I would love a solution to this issue. I'm including a working copy of the above test.
HttpRequest throws the following exception: "DOM access is not enabled in this isolate".


Attachments:
test.dart (361 Bytes)
test.html (332 Bytes)
worker.dart (455 Bytes)
test.txt (38 Bytes)
pubspec.yaml (74 Bytes)

@DartBot
Copy link
Author

DartBot commented Apr 23, 2014

This comment was originally written by @zoechi


this seems to be a duplicate of https://code.google.com/p/dart/issues/detail?id=10223

@alan-knight
Copy link
Contributor

Added Duplicate label.
Marked as being merged into #10223.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report library-isolate
Projects
None yet
Development

No branches or pull requests

5 participants