Skip to content

ListOutputStream doesn't support streaming #4335

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

Closed
nex3 opened this issue Aug 2, 2012 · 6 comments
Closed

ListOutputStream doesn't support streaming #4335

nex3 opened this issue Aug 2, 2012 · 6 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io

Comments

@nex3
Copy link
Member

nex3 commented Aug 2, 2012

The ListOutputStream API doesn't have any way of being notified of partial data being written, or consuming said data. It's only possible to consume the entire contents() at once, and the user is only notified that this is available once the stream has been closed.

@nex3
Copy link
Member Author

nex3 commented Aug 2, 2012

This is made worse by issue #4202, since it's not even safe for the code creating the ListOutputStream to register an onClosed handler since it might get clobbered later.

@whesse
Copy link
Contributor

whesse commented Aug 3, 2012

What we really want is a Filter or Buffer class that connects an InputStream and an OutputStream with a bounded or unbounded buffer, and provides the appropriate notifications. This could replace ListInputStream and ListOutputStream, or they could be left in.

One issue is whether we also want a non-copying buffer that puts the actual data objects that the InputStream received onto the OutputStream. This is really just a queue of data objects.

@nex3
Copy link
Member Author

nex3 commented Aug 3, 2012

I was thinking that it would be nice to have a single class that implements both InputStream and OutputStream with an internal buffer, but a connected pair would also work.

Doesn't OutputStream.write mandate that the buffer default to non-copying?

@nex3
Copy link
Member Author

nex3 commented Aug 3, 2012

It's worth noting that it would be possible to set this up manually if not for issue #4202. You could create a ListInputStream and a ListOutputStream, then use InputStream.pipe to connect them. However, as is, any events added to either stream clobber the piping infrastructure.

@nex3
Copy link
Member Author

nex3 commented Aug 6, 2012

r10298 adds an onData callback that supports this use-case. It would still be nice to have a more direct link between a ListInputStream and a ListOutputStream, though.


Added Fixed label.

@kevmoo
Copy link
Member

kevmoo commented May 14, 2014

Removed Area-IO label.
Added Area-Library, Library-IO labels.

@nex3 nex3 added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io labels May 14, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io
Projects
None yet
Development

No branches or pull requests

3 participants