Tag: 编年史队列

如何阅读Chronicle队列中的最后N个记录?

我有以下代码从Chronicle队列中读取(它是用Kotlin编写的,但没关系): val queue = ChronicleQueueBuilder.single(path).build() val tailer = queue.createTailer() tailer.toEnd() // // This code is wrong // val lastIndex = tailer.index() // // val shift = lastIndex – 10 // if (shift > 0) { // tailer.moveToIndex(lastIndex) // } while (true) { val text = await(tailer) if (prefix == null) { println(text) } else { […]