iamsmkr commented on issue #14089: URL: https://github.com/apache/arrow/issues/14089#issuecomment-1243031219
@lidavidm Thanks for your reply. I have written a small working example (in Scala) for you to have a look [here](https://github.com/iamsmkr/arrow-flight-scala). In the `Main.scala`, I am writing and reading in separate threads. What I would expect is that all batches are read as soon as they are written. However, I could do this only after "completing all sends per batch" i.e., calling `listener.completed()` after every `listener.putNext()`, as shown below: ```scala Future(reader.readMessages(1)) writer.addToBatch(0, "Shivam") writer.addToBatch(1, "Shyam") writer.addToBatch(2, "Srinivas") writer.sendBatch() writer.completeSend() Thread.sleep(1000) writer.addToBatch(0, "Neha") writer.addToBatch(1, "Naveen") writer.addToBatch(2, "Nisha") writer.sendBatch() writer.completeSend() ``` First read in the following version won't work! ```scala // Future(reader.readMessages(1)) writer.addToBatch(0, "Shivam") writer.addToBatch(1, "Shyam") writer.addToBatch(2, "Srinivas") writer.sendBatch() // writer.completeSend() reader.readMessages() // THIS DOESN'T READ THE FIRST BATCH AS EXPECTED! println(s"reading A") Thread.sleep(5000) writer.addToBatch(0, "Neha") writer.addToBatch(1, "Naveen") writer.addToBatch(2, "Nisha") writer.sendBatch() writer.completeSend() reader.readMessages() ``` Hope I could explain it better this time. Please suggest what changes could be made to fix this. Thanks! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
