Skip to content

Unable to spawn a dart-enabled web worker #21573

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 Nov 11, 2014 · 11 comments
Closed

Unable to spawn a dart-enabled web worker #21573

DartBot opened this issue Nov 11, 2014 · 11 comments
Assignees
Labels
closed-obsolete Closed as the reported issue is no longer relevant P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Nov 11, 2014

This issue was originally filed by [email protected]


What steps will reproduce the problem?

  1. Create a 'main.dart':

import 'dart:html';

void main() {
  var worker = new Worker('worker.dart');
}

  1. Create a 'main.html':

<html>
<body>
  <script type="application/dart" src="main.dart"></script>
</body>
</html>

  1. Create a 'worker.dart':

void main() {
  // Intentionally left blank.
}

  1. pub serve, and navigate to %host/main.html.

What is the expected output? What do you see instead?

  • I expect to see nothing
  • Instead I see an error that worker.dart is invalid JavaScript

In Dartium, enter chrome://version and paste the results here.

  • Version 37.0.2062.120 (292122) (64-bit)

Please provide any additional information below:

I need to create a web worker, in Dart, that has access to Timers and XmlHttpRequest. dart:isolate does not support this. dart:html.Worker does, in theory, but workers are not able to be used, at least in Dartium.

@sethladd
Copy link
Contributor

Do we even support the Worker class in Dartium?

Bumping to high for internal customer.


cc @terrylucas.
cc @a-siva.
Removed Priority-Unassigned label.
Added Priority-High label.

@sethladd
Copy link
Contributor

cc @cbracken.

@DartBot
Copy link
Author

DartBot commented Nov 11, 2014

This comment was originally written by @pjako


Dart in Webworkers was removed years ago, even if you compile to javascript you have no access to the worker context (and no possibility to use HttpRequest).

Related issue:
dartbug.com/1963

@DartBot
Copy link
Author

DartBot commented Nov 11, 2014

This comment was originally written by [email protected]


Why was it removed? Building a scaleable application is very limited in Dart if you don't have access to RPCs.

@kasperl
Copy link

kasperl commented Nov 28, 2014

Added this to the 1.9 milestone.

@DartBot
Copy link
Author

DartBot commented Nov 30, 2014

This comment was originally written by @pjako


The reason was that isolates are darts concurrency story not workers, which is fine. But isolates still lack in term of api in the browser, An isolate in the browser should be at least as powerful as a workers.in javascript. (IndexDB api, transferable arrays, XMLHttpRequest and all the other stuff that the worker context offers.)

@DartBot
Copy link
Author

DartBot commented Dec 6, 2014

This comment was originally written by @si-robertson


Is this on target for 1.9? It would be extremely useful to be able to run Dart scripts in web workers.

@a-siva
Copy link
Contributor

a-siva commented Feb 17, 2015

This change is not currently targeted for 1.9.


Removed this from the 1.9 milestone.

@kasperl
Copy link

kasperl commented Mar 20, 2015

Added this to the 1.10 milestone.

@alan-knight
Copy link
Contributor

Marked this as blocking #22862.

@dgrove
Copy link
Contributor

dgrove commented Apr 17, 2015

Removed this from the 1.10 milestone.
Added this to the 1.11 milestone.

@DartBot DartBot added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures labels Apr 17, 2015
@DartBot DartBot added this to the 1.11 milestone Apr 17, 2015
@kevmoo kevmoo removed this from the 1.11 milestone Jun 23, 2015
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Mar 1, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

8 participants