Gmousse / dataframe-js

No Maintenance Intended
https://gmousse.gitbooks.io/dataframe-js/
MIT License
460 stars 38 forks source link

How can I pass DataFrame object to worker ? #114

Open antoniopol06 opened 3 years ago

antoniopol06 commented 3 years ago

How can I pass DataFrame object to worker ?

I am trying to do that but I receive the following error:

DOMException: Failed to execute 'postMessage' on 'Worker': function Stat(df) {
    _classCallCheck(this, Stat);

    this.df = df;
    this.name = "stat";
  } could not be cloned.
Gmousse commented 3 years ago

Hi, In order to pass a DataFrame on a Worker or WorkerThread you have to serialize it before sending it and deserialize it on the dedicated Worker.

It's the case for all complex js objects.