Does java have the equivalent of pump mode to handle slow clients?

At present, we have an architecture in which the server streams data to the client We find that the client cannot process data quickly, the buffer overflows and the client is disconnected Node. JS has pump mode. If the data is not completely refreshed, the flow can be suspended and then resumed after the flow is emptied How to execute an equivalent pause / resume loop in Java?

Solution

It's not exactly the same, but to me it sounds like a variation of the producer / consumer theme Place a blocking queue between the two If the consumer cannot keep up, the blocking queue will continue to receive messages from the producer and accumulate them until the consumer is ready

Maybe you mean this

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>