There is a little long background story about the problem in my socket reactive library working process.
The socket library mainly based on a reactive library named Monix
(similar ReactiveX). Monix has the best practice to handle back-pressure by Ack
(extends Future) type which emits the next message when the current message has been processed. It's a good mechanism to protect the system for large message rushed.
Currently design, every socket connection is an Observable( or Stream), the Observable will create a protocol message when TCP/IP network bytes stream is parsed, and then, push the protocol message to Subscriber.
The problem is Monix library only could do back-pressure for every Observable. If you consider there are thousands of client connected there cloud be so many Observable and back-pressure is meaningless.
So, how to design a back-pressure mechanism for such reactive system in terms of a global system other than a single Observable?
Thanks