diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-04-04 01:00:59 -0700 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-04-04 01:00:59 -0700 |
| commit | c7c22e3db1c826bcfb2bc66651ec480aae0d4ae0 (patch) | |
| tree | 8546df448afef40d3814d2581f4dacff7cebb87f /node_modules/webworker-threads/test/test26_puts_with_many_args.js | |
Diffstat (limited to 'node_modules/webworker-threads/test/test26_puts_with_many_args.js')
| -rw-r--r-- | node_modules/webworker-threads/test/test26_puts_with_many_args.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/node_modules/webworker-threads/test/test26_puts_with_many_args.js b/node_modules/webworker-threads/test/test26_puts_with_many_args.js new file mode 100644 index 0000000..51f9e12 --- /dev/null +++ b/node_modules/webworker-threads/test/test26_puts_with_many_args.js @@ -0,0 +1,18 @@ +var Threads= require('webworker-threads'); + +function cb (err, msg) { + if (err) { + process.stdout.write("["+ this.id+ "] -> "+ err+ '\n'); + } + this.destroy(); +} + +function ƒ () { + var prefix= "["+ thread.id+ "] -> "; + puts(prefix+ "1\n", prefix+ "2\n", prefix+ "3\n", prefix+ "4\n", prefix+ "5\n"); +} + +var i= Math.abs(parseInt(process.argv[2], 10)) || 1; +console.log('Using '+ i+ ' threads'); + +Threads.createPool(i).all.eval(ƒ).all.eval('ƒ()', cb);
\ No newline at end of file |
