java - Netty 消息优先级

标签 java netty

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/

相关文章:

java - 通过 servlet 发送字节,得到 "HTTP method GET is not supported by this URL"

java - 找不到包裹

java类加载器

java - Spring 配置文件和测试

java - 如何在命令提示符下运行不同包中的java文件?

java - Netty客户端向服务器发送保持 Activity 状态

android - 如果 Tomcat 占用 80 端口,那么从 Android 到 Netty 远程服务器的 RPC 调用使用哪个端口?

netty - Apache Storm java.nio.channels.ClosedChannelException : null

sockets - 触发按需 TCP 消息到可重新连接、不可共享的 Netty 管道的正确方法是什么?