Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
set default bufferedMessaging in ThreadPool
Browse files Browse the repository at this point in the history
  • Loading branch information
amireh committed Aug 26, 2017
1 parent 35947c0 commit 13612f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
## HappyPack Changelog

### 4.0.0-beta.4

- Default to buffered messaging mode when using standalone thread pools on
Windows.

### 4.0.0-beta.3

Fixed bug around the use of `process.send()` that was causing a hang on
Expand Down
3 changes: 1 addition & 2 deletions lib/HappyPlugin.js
Expand Up @@ -9,7 +9,6 @@ var fnOnce = require('./fnOnce');
var ErrorSerializer = require('./ErrorSerializer');
var pick = require('./pick');
var pkg = require('../package.json');
var os = require('os');

function HappyPlugin(userConfig) {
if (!(this instanceof HappyPlugin)) {
Expand Down Expand Up @@ -42,7 +41,7 @@ function HappyPlugin(userConfig) {
// we don't want this to be documented / exposed since it's an
// implementation detail + not having it on means a bug, but we're making it
// configurable for testing purposes
bufferedMessaging: { type: 'boolean', default: os.platform() === 'win32' },
bufferedMessaging: { type: 'boolean', default: process.platform === 'win32' },
loaders: {
validate: function(value) {
if (!Array.isArray(value)) {
Expand Down
4 changes: 3 additions & 1 deletion lib/HappyThreadPool.js
Expand Up @@ -44,7 +44,9 @@ module.exports = function HappyThreadPool(config) {
id: config.id,
verbose: config.verbose,
debug: config.debug,
buffered: config.bufferedMessaging,
buffered: config.hasOwnProperty('bufferedMessaging') ?
config.bufferedMessaging :
process.platform === 'win32',
});

var getThread = RoundRobinThreadPool(threads);
Expand Down

0 comments on commit 13612f8

Please sign in to comment.