UnzipFile
interface: "occasionally the stream will be enabled even without start()
being called"
#240
Unanswered
valadaptive
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The
start()
method of theUnzipFile
interface says:This is quite vague. I can't tell from reading the source code when exactly this will happen.
If one wants to implement an API where the consumer is given a list of files in a .zip archive and can decide when to unzip them, it's made way more complicated if the files can decide to randomly start streaming themselves.
If zipped files only began streaming when you called
start()
, I could just store a map of filenames toUnzipFile
s, and then begin unzipping each file only when the API consumer asked for it. But if anUnzipFile
can start streaming at any point, we need to attach anondata
handler to each file immediately to avoid missing any events, and squirrel away any data that starts streaming early. This is an entire extra code path that may not ever be exercised.Under what circumstances will an
UnzipFile
's stream be enabled without us callingstart()
?Beta Was this translation helpful? Give feedback.
All reactions