Skip to content

Commit

Permalink
Rename useSeparateProcesses option to useChildProcesses
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Sep 2, 2019
1 parent 245d8a7 commit e872a4c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -121,7 +121,7 @@ All CLI options are optional:
--printOutput Turns on logging of your lambda outputs in the terminal.
--resourceRoutes Turns on loading of your HTTP proxy settings from serverless.yml
--skipCacheInvalidation -c Tells the plugin to skip require cache invalidation. A script reloading tool like Nodemon might then be needed
--useSeparateProcesses Run handlers in separate Node processes
--useChildProcesses Run handlers in a child process
--useWorkerThreads Uses worker threads for handlers. Requires node.js v11.7.0 or higher
--websocketPort WebSocket port to listen on. Default: 3001
```
Expand Down
4 changes: 2 additions & 2 deletions src/api-gateway/ApiGateway.js
Expand Up @@ -546,13 +546,13 @@ export default class ApiGateway {
// Failure handling
let errorStatusCode = '502'
if (err) {
// Since the --useSeparateProcesses option loads the handler in
// Since the --useChildProcesses option loads the handler in
// a separate process and serverless-offline communicates with it
// over IPC, we are unable to catch JavaScript unhandledException errors
// when the handler code contains bad JavaScript. Instead, we "catch"
// it here and reply in the same way that we would have above when
// we lazy-load the non-IPC handler function.
if (this._options.useSeparateProcesses && err.ipcException) {
if (this._options.useChildProcesses && err.ipcException) {
return this._reply500(
response,
`Error while loading ${functionName}`,
Expand Down
2 changes: 1 addition & 1 deletion src/config/defaults.js
Expand Up @@ -15,7 +15,7 @@ export default {
printOutput: false,
resourceRoutes: false,
skipCacheInvalidation: false,
useSeparateProcesses: false,
useChildProcesses: false,
useWorkerThreads: false,
websocketPort: 3001,
}
2 changes: 1 addition & 1 deletion src/config/options.js
Expand Up @@ -63,7 +63,7 @@ export default {
usage:
'Tells the plugin to skip require cache invalidation. A script reloading tool like Nodemon might then be needed',
},
useSeparateProcesses: {
useChildProcesses: {
usage: 'Uses separate node processes for handlers',
},
useWorkerThreads: {
Expand Down
4 changes: 2 additions & 2 deletions src/lambda/handler-runner/HandlerRunner.js
Expand Up @@ -15,7 +15,7 @@ export default class HandlerRunner {
async _loadRunner() {
const {
skipCacheInvalidation,
useSeparateProcesses,
useChildProcesses,
useWorkerThreads,
} = this._options

Expand All @@ -32,7 +32,7 @@ export default class HandlerRunner {
)
}

if (useSeparateProcesses) {
if (useChildProcesses) {
const { default: ChildProcessRunner } = await import(
'./ChildProcessRunner.js'
)
Expand Down

0 comments on commit e872a4c

Please sign in to comment.