// FIXME: Store Promises in the peekQueue instead? Or would this make it more difficult to deal with concurrent peeks/reads? And should the peek spec be changed to account for this?
// FIXME: What if there's an EndOfStream marker being produced? Or an abort? Or some other sort of failure? Shouldn't that return/produce something *other than* `true`?
returntrue;
});
}
});
},
read:functionproduceValue_simpleSource(){
returnPromise.try(()=>{
if(peekQueue.length>0){
/* FIXME: Move all this logic out into an itemBuffer abstraction of some sort (also useful in from-node-stream?) */
thrownewError("You must specify a reason (either `true` or an Error object) when aborting a stream");
}
}else{
// FIXME: Require this behaviour in the spec? Or is there a composability-related reason to permit/require quietly ignoring this, to make it idempotent?