Commit ce2a801
committed
feat: allow setting timeout when using childProcess
In Node.js you can set timeout option to child processes started with `exec`. However, there's no support for this when using `spawn`.
Add support for passing timeout in our abstraction of childProcess, when using `spawnFromEvent` method. When this method is used, it blocks the operation until the process finishes its execution. So it is appropriate to pass timeout and if it passes, send `SIGTERM` signal to the child process. This is the same signal used by Node.js when the timeout is hit in `child_process.exec`.1 parent 6e366d8 commit ce2a801
2 files changed
+26
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
66 | 74 | | |
67 | 75 | | |
68 | 76 | | |
| |||
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
94 | 114 | | |
95 | 115 | | |
96 | 116 | | |
97 | 117 | | |
98 | | - | |
99 | | - | |
| 118 | + | |
100 | 119 | | |
101 | 120 | | |
102 | 121 | | |
103 | | - | |
104 | | - | |
| 122 | + | |
105 | 123 | | |
106 | 124 | | |
107 | 125 | | |
| |||
111 | 129 | | |
112 | 130 | | |
113 | 131 | | |
| 132 | + | |
114 | 133 | | |
115 | 134 | | |
116 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
651 | | - | |
| 651 | + | |
| 652 | + | |
652 | 653 | | |
653 | 654 | | |
654 | 655 | | |
| |||
0 commit comments