AsyncFile asyncFile = vertx.fileSystem().openBlocking(/*path and options*/);
RecordParser recordParser = RecordParser.newDelimited("\n", buffer -> {
// Do something per line
});
Pump.pump(asyncFile, recordParse).start(); // Error - RecordParser cannot be converted to WriteStream
RecordParser recordParser = RecordParser.newDelimited("\n", buffer -> {
// Do something per line, this gets called per line successfully
})
.exceptionHandler(cause -> {
// Do I need this? What are the repercussions if I don't have this handler? Are exceptions just lost?
})
.endHandler(_void -> {
// This never gets called!
});
asyncFile.handler(recordParser);--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/25e9b7e5-01c9-4694-ac80-bcbf500caec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/25e9b7e5-01c9-4694-ac80-bcbf500caec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/4E0A46E4-2459-44BC-AB13-4E118A4C9060%40julienviet.com.
AsyncFile asyncFile = vertx.fileSystem().openBlocking(filename, fileOptions);
asyncFile.exceptionHandler(cause -> {
// Would love to catch all exceptions, log them, fail a promise, close the file, etc.
// but I can't throw a caught exception in my output handler and a runtime exception doesn't propagate to this handler
}).endHandler(aVoid -> {
asyncFile.close();
});
RecordParser recordParser = RecordParser.newDelimited("\n");
asyncFile.handler(recordParser);
recordParser.setOutput(bufferedLine -> {
// throw new Exception("foo"); // Java doesn't allow me to throw checked exception in a lambda
// throw new RuntimeException("foo"); // Doesn't propagate to asyncFile.exceptionHandler (not recordParser.exceptionHandler)
});Hi,
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/25e9b7e5-01c9-4694-ac80-bcbf500caec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/2fcc7949-dfba-481d-a4ec-3e43019abc8a%40googlegroups.com.