()
| 513 | // Retired proxy processes still running commands |
| 514 | const retired = new Set<Proxy>() |
| 515 | const get = () => { |
| 516 | if (current.exited) { |
| 517 | current = new Proxy(options) |
| 518 | } else if (current.credentials !== credentials()) { |
| 519 | // The application changed its credentials, so its commands must not |
| 520 | // run with the old ones |
| 521 | const previous = current |
| 522 | current = new Proxy(options) |
| 523 | retired.add(previous) |
| 524 | previous.retire() |
| 525 | } |
| 526 | for (const proxy of retired) { |
| 527 | if (proxy.exited) retired.delete(proxy) |
| 528 | } |
| 529 | return current |
| 530 | } |
| 531 | const toError = toStartError(options) |
| 532 | // Waits, interruptibly, for a proxy process that is ready to take spawns. |
| 533 | // Nothing has been sent while waiting, so interruption has nothing to undo. |
no test coverage detected