-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(worker-fork): allow passing fork options (#2795)
- Loading branch information
1 parent
626d9cd
commit f7a4292
Showing
8 changed files
with
125 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx npm-run-all pretty:quick lint:staged | ||
yarn npm-run-all pretty:quick lint:staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { ForkOptions } from 'child_process'; | ||
import { WorkerOptions as WorkerThreadsOptions } from 'worker_threads'; | ||
|
||
export interface SandboxedOptions { | ||
/** | ||
* Use Worker Threads instead of Child Processes. | ||
* Note: This option can only be used when specifying | ||
* a file for the processor argument. | ||
* | ||
* @default false | ||
*/ | ||
useWorkerThreads?: boolean; | ||
|
||
/** | ||
* Support passing Worker Fork Options. | ||
* Note: This option can only be used when specifying | ||
* a file for the processor argument and useWorkerThreads is passed as false (default value). | ||
* @see {@link https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options} | ||
*/ | ||
workerForkOptions?: ForkOptions; | ||
|
||
/** | ||
* Support passing Worker Threads Options. | ||
* Note: This option can only be used when specifying | ||
* a file for the processor argument and useWorkerThreads is passed as true. | ||
* @see {@link https://nodejs.org/api/worker_threads.html#new-workerfilename-options} | ||
*/ | ||
workerThreadsOptions?: WorkerThreadsOptions; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters