dart-archive / isolate

Makes working with Dart isolates easier.
https://pub.dev/packages/isolate
BSD 3-Clause "New" or "Revised" License
90 stars 34 forks source link

Clarify that this package doesn't work on the web in README #10

Closed filiph closed 5 years ago

filiph commented 7 years ago

Since this package uses Isolate.spawn, it won't work for web apps (unless those apps use it in a non-DOM isolate). https://github.com/dart-lang/sdk/issues/17649

This should be mentioned prominently in the readme, lest we frustrate people who try this package for this very reason.

I can prepare the PR if you agree with this.

filiph commented 7 years ago

I just realized it's not just that, but also the fact that IsolateRunner.run() takes a closure and Isolates on the web can't serialize closures.

Since IsolateRunner doesn't provide any function to send/receive values (like with the underlying isolate receivePort/sendPort architecture), it's not useful on the web even if the developer chooses to use it manually (using IsolateRunner() constructor instead of IsolateRunner.spawn()).

lrhn commented 5 years ago

Adding this to the readme.