()
| 300 | export const getExecutorBundle = () => loadSharedHandle(); |
| 301 | |
| 302 | export const disposeExecutor = async (): Promise<void> => { |
| 303 | const currentHandlePromise = sharedHandlePromise; |
| 304 | sharedHandlePromise = null; |
| 305 | |
| 306 | const disposeCurrent = async (): Promise<void> => { |
| 307 | const handle = currentHandlePromise ? await handleOrNull(currentHandlePromise) : null; |
| 308 | if (handle) { |
| 309 | await ignorePromiseFailure("disposeExecutor", () => handle.dispose()); |
| 310 | } |
| 311 | }; |
| 312 | |
| 313 | const nextLifecycle = sharedHandleLifecycle.then(disposeCurrent, disposeCurrent); |
| 314 | sharedHandleLifecycle = nextLifecycle.then( |
| 315 | () => undefined, |
| 316 | () => undefined, |
| 317 | ); |
| 318 | await nextLifecycle; |
| 319 | }; |
| 320 | |
| 321 | export const reloadExecutor = async () => { |
| 322 | await disposeExecutor(); |
no outgoing calls