Add web front-end and fix API issues
This commit is contained in:
1 parent
45ca4de0ad
commit
a7524412f0
2571 files changed
+86998
-5
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
import { fromSharedEvent } from '../observables.js';
|
||||
/**
|
||||
* Kills processes and aborts further command spawning on output stream error (namely, SIGPIPE).
|
||||
*/
|
||||
export class OutputErrorHandler {
|
||||
outputStream;
|
||||
abortController;
|
||||
constructor({ abortController, outputStream, }) {
|
||||
this.abortController = abortController;
|
||||
this.outputStream = outputStream;
|
||||
}
|
||||
handle(commands) {
|
||||
const subscription = fromSharedEvent(this.outputStream, 'error').subscribe(() => {
|
||||
commands.forEach((command) => command.kill());
|
||||
// Avoid further commands from spawning, e.g. if `RestartProcess` is used.
|
||||
this.abortController.abort();
|
||||
});
|
||||
return {
|
||||
commands,
|
||||
onFinish: () => subscription.unsubscribe(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user