Skip to content
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

Create helper for streaming file #49

Closed
rmariano opened this issue Sep 12, 2017 · 0 comments
Closed

Create helper for streaming file #49

rmariano opened this issue Sep 12, 2017 · 0 comments
Assignees

Comments

@rmariano
Copy link
Owner

Helper object that will yield the contents of the file reading by a given buffer size.

Conditions:

  • A file-like object
  • Context manager, making sure the file is closed upon completion.
  • Iterable

pseudocode:

with IterableFile('/tmp/foo/bar') as streamed_file:
     for chunk in streamed_file.stream(buffer_size=1024):
             print(chunk)
@rmariano rmariano self-assigned this Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant