Skip to content

Commit a934701

Browse files
Merge pull request #268 from ahocevar/worker
Simplify worker handling
2 parents 4f4d116 + 7ef9c2e commit a934701

File tree

12 files changed

+1209
-229
lines changed

12 files changed

+1209
-229
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ node_modules
33
dist
44
dist-node
55
dist-browser
6+
dist-module
67
docs
7-
.DS_Store
8+
.DS_Store

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
docs
2-
test
2+
test
3+
src
4+
scripts

README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -296,28 +296,6 @@ const data = await image.readRasters({ pool });
296296
It is possible to provide a pool size (i.e: number of workers), by default the number
297297
of available processors is used.
298298

299-
Because of the way WebWorker work (pun intended), there is a considerable overhead
300-
involved when using the `Pool`, as all the data must be copied and cannot be simply be
301-
shared. But the benefits are two-fold. First: for larger image reads the overall time
302-
is still likely to be reduced and second: the main thread is relieved which helps to
303-
uphold responsiveness.
304-
305-
If you want to use the Worker Pool in a project built with webpack (ex: VueJS or React) you have to install `threads-plugin` and add the plugin to your `webpack.config.js`:
306-
```
307-
npm install -D threads-plugin
308-
```
309-
310-
```javascript
311-
const ThreadsPlugin = require('threads-plugin')
312-
313-
module.exports = {
314-
// ...
315-
plugins: [
316-
new ThreadsPlugin()
317-
]
318-
}
319-
````
320-
321299
### Dealing with visual data
322300

323301
The TIFF specification provides various ways to encode visual data. In the

0 commit comments

Comments
 (0)