├── .eslintrc ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── bower.json ├── dist ├── evalworker.min.js ├── threadpool.js └── threadpool.min.js ├── gulpfile.js ├── lib ├── ThreadPool │ ├── Job.js │ ├── Thread.js │ ├── ThreadPool.js │ ├── WorkerFactory.js │ └── WorkerWrapper.js ├── evalworker.js ├── genericWorker.js └── index.js ├── package.json ├── samples ├── count.html ├── error.html ├── index.html └── style.css ├── spec ├── helpers.js └── threadpool.spec.js └── src ├── ThreadPool ├── Job.js ├── Thread.js ├── ThreadPool.js ├── WorkerFactory.js └── WorkerWrapper.js ├── evalworker.js ├── genericWorker.js └── index.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "ecmaFeatures" : { 3 | "arrowFunctions" : true, 4 | "blockBindings" : true, 5 | "classes" : true, 6 | "defaultParams" : true, 7 | "destructuring" : true, 8 | "jsx" : true, 9 | "modules" : true, 10 | "restParams" : true 11 | }, 12 | "env" : { 13 | "browser" : true, 14 | "node" : true 15 | }, 16 | "globals" : { 17 | "Blob" : true, 18 | "BlobBuilder" : true 19 | }, 20 | "rules" : { 21 | "global-strict" : 0, 22 | "key-spacing" : [0, { "beforeColon": false, "afterColon": true }], 23 | "no-multi-spaces" : 0, 24 | "quotes" : [1, "single", "avoid-escape"] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .publish 3 | bower_components 4 | node_modules 5 | public 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | node_js: 4 | - "0.12" 5 | - "4.1" 6 | 7 | # Here comes the stuff to make webworker-threads work: 8 | 9 | install: 10 | - CXX="g++-4.8" CC="gcc-4.8" npm install 11 | 12 | # thanks to http://stackoverflow.com/a/30925448/1283667: 13 | addons: 14 | apt: 15 | sources: 16 | - ubuntu-toolchain-r-test 17 | packages: 18 | - gcc-4.8 19 | - g++-4.8 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Andy Wermke 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## threadpool.js [](https://travis-ci.org/andywer/threadpool-js) [](http://badge.fury.io/js/threadpool-js) [](http://badge.fury.io/bo/threadpool-js) 2 | 3 | __Deprecation notice: This package is near its end of life. Switch to [threads.js](https://github.com/andywer/threads.js) instead. It provides the same features plus additional ones and is generally more awesome :)__ 4 | __PS: If you feel different about it, feel free to open an issue.__ 5 | 6 | _threadpool.js_ is aimed to be a general-purpose multi-threading library for Javascript. 7 | Its key features are *portability* and *ease of use*. The library can either be used in a stand-alone fashion or as a *[require.js](http://requirejs.org/)* module. 8 | 9 | ## Usage 10 | 11 | You can add threadpool-js to your project using npm or bower: 12 | 13 | ```bash 14 | npm install --save threadpool-js 15 | # or 16 | bower install --save threadpool-js 17 | ``` 18 | 19 | Or just by adding this script tag: 20 | 21 | ```html 22 | 23 | ``` 24 | 25 | ## Example use 26 | 27 | Include the library at first. Just add the *threadpool.js* file to your project and include it per ` 6 | 7 | 8 | 9 |
10 |