- From: Ben Kelly <notifications@github.com>
- Date: Wed, 11 Feb 2015 10:22:34 -0800
- To: whatwg/streams <streams@noreply.github.com>
Received on Wednesday, 11 February 2015 18:23:06 UTC
I think you're right that `free` does not make sense. If anything, the consumer would need to be doing the free'ing not the stream. So it can just handle that logic itself if necessary.
I guess that raises the question if allocate() can return a promise to delay the next fread() until a re-usable block is ready to be processed again.
I didn't consider that `fread()` would actually be triggered by `setAllocator()`. I understand that a bit better now. Would we want a better name?
Its not completely clear to me how this would interact with `readInto()`, though. Consider:
```
rbs.setAllocator(function() { return new ArrayBuffer(1024);}
rbs.readInto(buf, 0, 512);
rbs.read(); // what exactly does this return? a slice of the allocator returned buffer?
```
---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/253#issuecomment-73934220
Received on Wednesday, 11 February 2015 18:23:06 UTC