Netty 中是否有任何嵌入式优先级机制可以帮助我决定哪些消息比其他消息更频繁地发送?
最佳答案
您可以使用 BufferedWriteHandler 优先写入这需要使用未绑定(bind)的优先级队列来实现。引用 JavaDocs:
You can implement prioritized writes by specifying an unbounded priority queue in the constructor of this handler. It will be required to design the proper strategy to determine how often flush() should be called. For example, you could call flush() periodically, using HashedWheelTimer every second.
关于java - Netty 消息优先级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10799117/