-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(xsnap): Iron out resolution types
The xsnap controller passes a "baton" from the completion of one interaction with the xsnap subprocess to the next, regardless of whether the interaction completed sucessfully. The xnsap controller can also kill the subprocess, and the child can terminate unexpectedly, so every interaction is a race to completion or the child process exiting. In a prior solution to the baton passing, the result of an interaction could be a rejection. To allow the next interaction to commence, the baton would commence with the conclusion of the prior interaction, and if that produced an exception, the rejection would be caught and transformed into a resolution to an error. This is weird. This change makes both the child process exit and the baton promise the same type: Promise<void> and termination is always communicated as a rejection. This change also adds a `terminate` method to allow a distinction between graceful close and forced termination.
- Loading branch information
Showing
1 changed file
with
29 additions
and
19 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