1.0.3 • Published 5 years ago

classy-threads v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

ClassyThreads

WorkerThreads made easy

Features

  • uses indexedDB to transfer the data instead of serializing which can lock up the main thread for large arguments

@TODO:

  • extrapolate function arguements from the function itself, currently you need to specify the arguments .

Decorate a class to gain a threads attribute

import {withClassyThreads} from 'classy-threads';
import someFunction from './functions/someFunction';

@withClassyThreads()
export myClass {

  constructor() {
    this.threads.spawn({name: 'myworkers});
    this.attachFunctions();
  }
  
  attachFunctions() {

    this.threads.myworkers.attachFunction({fn: someFunction, args: ['arg1', 'arg2']});
  }
 
}
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago