Re: [streams] How will ReadableByteStream work with seekable resources? (#253)

### Issue: Supporting platform with only async reading I/O without losing efficiency

Started from https://github.com/whatwg/streams/issues/253#issuecomment-73618925

Plans:
- async read() https://github.com/whatwg/streams/pull/288
- pull() + sync read() https://github.com/whatwg/streams/issues/289
- sync read() + OperationStatus https://github.com/whatwg/streams/pull/287

### Issue: Detaching ArrayBuffer

ArrayBuffers should be detached at the borders between user code and underlying platform code appropriately.

Started from https://github.com/whatwg/streams/issues/253#issuecomment-75197506

### Issue: Locking

We should give clear semantics to locking infrastructure.

Summarizing discussion started from https://github.com/whatwg/streams/pull/288#issuecomment-75747164 and Yutaka's comment https://github.com/whatwg/streams/pull/288#issuecomment-75787952

For async read() plan, we have the following options:

1. s.getReader() fails if there's any pending read() operation.
1. s.getReader() causes any pending read() operation to stay pending until release, at which time it re-polls the queue
1. s.getReader() doesn't affect pending read() operations.

For pull() + sync read(),

1. TBA

### Issue: Simpleness of manual reading

Copied from https://github.com/whatwg/streams/pull/288#issuecomment-76885522

| | pull() + sync read() | async read() | sync read() + OperationStatus |
|----|--------------------|--------|----|
| handling read data | **easy**. for-loop + readableness check | promise based. one microtask for each chunk | for-loop + readableness check as long as status.state is "complete". Otherwise, need to wait using status.ready. Cumbersome. Complex. |
| correspondence between pull() and read() | less clear | **clear** | **clear** |



---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/253#issuecomment-76889060

Received on Tuesday, 3 March 2015 05:23:10 UTC