You are correct in that you should call uploadStream.write chronologically
with each buffer and if a new buffer comes in before the uploadStream can
process it, it should be buffered and then processed when the
uploadStream.write callback is triggered. I know Vert.x has back pressure
support via the reactive streams
<http://vertx.io/docs/vertx-reactive-streams/java/> api, so it may be
possible to convert the code that writes the data to that API and save
replicating the buffering logic
In case I implement my own AsyncInputStream, the same thing applies. I
would need to somehow buffer the data until the read method is called by
the driver where I can provide a slice of data, which in turn seems quite
cumbersome to me. And just in case, if the next slice of data is not yet
available when the read method is called, and I provide 0 bytes, does the
driver periodically poll if the data is available yet?
I'm not sure I follow here, but given that when reading data from GridFS
you can provide the buffer which will be used and information about the
bytes transferred in the callback. So I think I'm missing something here,
could you provide an example of using that kind of api in Vert.x?
You received this message because you are subscribed to the Google Groups "mongodb-user"