JavaScript multithreading library using web workers. It simplifies the use of web workers and provides an easy way to run functions in real threads.
- Single threads
- Thread pools
- RequireJS support
- Promise support
thread-worker is available as bower package.
bower install thread-worker
Or you can download the latest release from the releases page and copy the files from dist
folder to your project.
To use thread-worker, the browser has to support web workers and promises.
thread-woker can be used as stand-alone library or as RequireJS module.
To load it as stand-alone library just include the script into your page. thread-worker is then available as global object threadWorker
.
<script src="path/to/thread-woker/thread-worker.min.js"></script>
To use thread-woker with RequireJS, simply fetch the module.
var threadWorker = require('thread-worker');
For a full list of available objects and functions, see the API.
More detailed usage examples coming soon.