You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we signal the end of the stream by returning less data than the user requested. (it will block the task until all the data is available or we hit EOF). Julia IO streams support the eof method, which I think simplifies the logic working with streams somewhat.
current approach:
buf =SampleBuf(Float32, CHUNK_FRAMES, 2)
whiletrue
n =read!(stream, buf, CHUNK_FRAMES)
# process `n` frames from buf
n == CHUNK_FRAMES ||breakend
vs.
buf =SampleBuf(Float32, CHUNK_FRAMES, 2)
while!eof(stream)
n =read!(stream, buf, CHUNK_FRAMES)
# process `n` frames from bufend
It would be pretty easy to add eof, the question is whether we modify the stream semantics to allow a short read when we're not at the end of the stream, and only rely on eof. My current feeling is that's a cleaner design, I'm mostly hesitant about the churn.
The text was updated successfully, but these errors were encountered:
Currently we signal the end of the stream by returning less data than the user requested. (it will block the task until all the data is available or we hit EOF). Julia IO streams support the
eof
method, which I think simplifies the logic working with streams somewhat.current approach:
vs.
It would be pretty easy to add
eof
, the question is whether we modify the stream semantics to allow a short read when we're not at the end of the stream, and only rely oneof
. My current feeling is that's a cleaner design, I'm mostly hesitant about the churn.The text was updated successfully, but these errors were encountered: