Update pipe-ipc.js

This commit is contained in:
Namhyeon Go 2022-09-27 18:31:45 +09:00 committed by GitHub
parent 43649a5c16
commit 3294e23e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,16 @@ function PipeIPC() {
return text;
};
this.readContinuously = function(callback) {
var isNext = true;
if (typeof callback === "function") {
while (isNext) {
isNext = callback(this, this.read());
}
}
};
this.close = function() {
this.closeWriter();
this.closeReader();