node-rados icon indicating copy to clipboard operation
node-rados copied to clipboard

expose createReadStream / createWriteStream

Open 1N50MN14 opened this issue 9 years ago • 2 comments

Hi @ksperis thank you very much for making this available in node.js! ;)

Would it be possible for you wrap / expose a node.js style createReadStream and createWriteStream around io_read() and io_write()?

This would make it easier to do something like: bufferStream.pipe(ioctx.createWriteStream('obj-id'))

1N50MN14 avatar Feb 23 '16 14:02 1N50MN14

oh I just saw in your test file ioctx.createReadStream is already exposed, apologies about that I didn't see it in the README. Would it be possible to expose createWriteStream in the same manner?

1N50MN14 avatar Feb 23 '16 14:02 1N50MN14

hi @1N50MN14, I added a simple implementation of createWrtiteStream https://github.com/ksperis/node-rados/commit/5bf1a53fb1a0556e8c4fe81832c9f647a2b557be . I think this should be more tested, because the calls are asynchronous and we must be sure that writes are well ordered.

ksperis avatar Mar 01 '16 13:03 ksperis