classy-threads
v1.0.3
Published
Webworkers made easy
Downloads
10
Readme
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']});
}
}