File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/node-runtime-worker-thread/src Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
import { once } from 'events' ;
17
17
import { SHARE_ENV , Worker } from 'worker_threads' ;
18
+ import fs from 'fs' ;
18
19
import path from 'path' ;
19
20
import { exposeAll , createCaller } from './rpc' ;
20
21
import { InterruptHandle , interrupt as nativeInterrupt } from 'interruptor' ;
21
22
22
23
const workerRuntimeSrcPath = path . resolve ( __dirname , 'worker-runtime.js' ) ;
23
24
24
- const workerProcess = new Worker ( workerRuntimeSrcPath , { env : SHARE_ENV } ) ;
25
+ const workerProcess = new Worker (
26
+ // It's fine in this use-case: this process is spawned so we are not blocking
27
+ // anything in the main process
28
+ // eslint-disable-next-line no-sync
29
+ fs . readFileSync ( workerRuntimeSrcPath , 'utf8' ) ,
30
+ { env : SHARE_ENV , eval : true }
31
+ ) ;
25
32
26
33
// We expect the amount of listeners to be more than the default value of 10 but
27
34
// probably not more than ~25 (all exposed methods on
You can’t perform that action at this time.
0 commit comments