Debian Codegraph @

workerpool/examples/browser/workerWithOptions.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Worker pool in the browser</title>
5
6 <script src="../../dist/workerpool.js"></script>
7 </head>
8 <body>
9
10 <script>
11 // create a worker pool
12 const options = {
13 workerOpts: {
14 name: 'NamedWorker'
15 }
16 }
17 var pool = workerpool.pool('../workers/browserWorker.js', options);
18
19 pool.exec('getName')
20 .then(result => {
21 document.write('Workers in pool have the name "' + result + '" given in workerOpts');
22 })
23
24 </script>
25
26 </body>
27 </html>