1

I have compiled some dart code to javascript, and I want to run this code within a webworker. I don't attempt to access the DOM or anything in the worker, so it should work fine. However, I cannot respond to the onmessage event or call postMessage. There just isn't anything in the dart class library that would let me do so. The official JS interop library is more or less useless to me, because it just generates script tags, and that won't work in a webworker. So how can I get dart2js to emit some JS that will allow me to use onmessage and postMessage? Or should I be using a different strategy?

Zane Kaminski
  • 529
  • 4
  • 13

1 Answers1

0

The Worker class seems to support what you want.

Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275