Open mafintosh opened 9 years ago
This would be rad. @mafintosh are you still interested in writing a patch? If you're not interested, I could give it a shot.
Go for it @yoshuawuyts. I recently wrote this, https://github.com/mafintosh/bulk-write-stream if you need inspiration
Thanks, will do! 🌴
Ooph, doing this how bulk-write-stream
does it requires a complete rewrite of the module. I'm currently writing this in a separate module, but if OK I'm definitely willing to pull it in here.
@yoshuawuyts did you ever implement this?
@blahah nope
In the later version of readable-stream (1.1 and above) there is a new write method available called
._writev
that you can implement if you support batched writes (which leveldb does!). Basically it allows us to do something like this:The
_writev
method will be called with all the objects currently buffered in the stream (usually the same as highWaterMark) waiting to be written. This means that all pending writes will be added to a leveldb batch.If this is something you'd be interested in using for level-write-stream I'd be happy to send a PR