Hamsters.js: React-native android side, typeerror using hamsters and react-native-threads

Hello

I’m getting error message using hamsters and react-native-threads. I’m able to use both but still get typeError.

New Issue Report

  • What version of the library are you using? react-native: 0.55.2 react-native-threads: 0.0.13 hamsters: 5.1.1

  • What operating system are you seeing the issue on? Android / React-native

I’m able to call up the worker and it does it’s job but I get this typeError message, so I’m not sure if I’m benefitting from using hamsters or not.

Hamsters.js v5.1.1 Info: Preparing the hamster wheels & readying hamsters @ 1542796747783
hamsters.node.min.js:1 Hamsters.js v5.1.1 Info: 16 Logical Threads Detected, Spawning 16 Hamsters @ 1542796747784
CameraScreen.js:547 TypeError: f.default.SharedWorker is not a constructor
    at e.value (hamsters.node.min.js:1)
    at e.value (hamsters.node.min.js:1)
    at e.value [as init] (hamsters.node.min.js:1)
    at CameraScreen.js:540
    at tryCallOne (core.js:37)
    at core.js:123
    at JSTimers.js:295
    at _callTimer (JSTimers.js:152)
    at _callImmediatesPass (JSTimers.js:200)
    at Object.callImmediates (JSTimers.js:464)

The code I use to call upp the hamster is:

hamsters.init({
                     maxThreads: 16,
                     Worker: this.workerThread.postMessage( workerMessage )
                   })

Is there some better way of using react-native-threads and hamsters together ?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (13 by maintainers)

Most upvoted comments

Great thanks I will test this.