-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add :nomore_files to return stream #4
base: master
Are you sure you want to change the base?
Conversation
Previously, {:new_file, name} is not returned after the last file, this makes it difficult for downstream to know that the last chunk has been received, so as to return a stream item indicating that all binary chunks of the file has been fully received/processes. For example, if using after_fun in `ZipStream.unzip |> Stream.transform`, there would be no way to return, `{:ok, file_name}` indicating that the last file is complete.
API is changes as `:nomore_files` atom is expected in the returned stream from `ZipStream.unzip/1`
Yes good catch, useful because the PS: thank you ! |
Ah... I missed the tests. Will work on them and get back. On Friday, 29 July 2016, Arnaud Wetzel [email protected] wrote:
|
Is there a style of API that you prefer? Is :nomore_files ok, or something else? @awetzel |
The typical way is to just use |
Currently, {:new_file, nil} is not returned after the last file, this makes it difficult for downstream to know that the last chunk has been received. This means that the downstream cannot return an item indicating that all binary chunks of the last file have been fully received/processes.
For example, if using after_fun in
ZipStream.unzip |> Stream.transform
, there would be no way to return,{:ok, file_name}
indicating that the last file is complete.