Where should a class like this add try-with-resources so that it correctly closes resources? I presume the appender should be reused as shown, right?
public class ChronicleWriter implements UpdateListener {
private ExcerptAppender appender;
private SingleChronicleQueue queue;
public ChronicleWriter(Path p) {
queue = SingleChronicleQueueBuilder.binary(p).build();
appender = queue.acquireAppender();
}
@Override
public void onUpdate(String text) {
appender.writeText(text);
}
}