joltup / react-native-threads

Create new JS processes for CPU intensive work
MIT License
756 stars 142 forks source link

Got the project running, but `postmessage` never reaches my `worker.thread.js` #89

Closed Genhain closed 5 years ago

Genhain commented 5 years ago

I had to manually install as automatic would never run. however i eventually got it running and have placed breakpoints in XCode and confirm that postmessage is being called but the said message never reaches my worker.thread.js

I also had to specify an absolute path for it to work like so

componentDidMount() {
    this.fetchPartiesAndPopulatePartyList()
    this.workerThread = new Thread('src/app/components/party/worker.thread.js')
    this.workerThread.onmessage = this.handleMessage;

    setTimeout(() => {
      this.workerThread.postMessage('Hello')
    }, 1000);

  }
otherwise it would say the file did not exist.

and here is my worker thread.js
Genhain commented 5 years ago

Duplicated