But I think a more elegant system could be built-in within flow.js.
Eg: streamRead: <boolean> : Set to true to avoid concurrent calls to read()
And readState could be made a Promise that readFinishedresolves so that other chunks could await based on this promise completion status.
I'm reading from a stream instead of a blob I could slice. In order to solve this problem, I had to implement a poor-man semaphore based on
readState
.But I think a more elegant system could be built-in within flow.js. Eg:
streamRead: <boolean>
: Set totrue
to avoid concurrent calls toread()
AndreadState
could be made aPromise
thatreadFinished
resolves so that other chunks could await based on this promise completion status.See also: #296 and #304