What's the best way to maintain a continuous reactive stream via Proteus?


#1

I’m working on a demo application using RSocket and Proteus. I’d like to set up a service that provides connected clients with a stream of real-time information. In the Javascript examples I’ve seen, there tend to be two patterns for accomplishing this: polling the service from the client, or setting the request count on the client side to a very high number. Is there a more reactive way of doing this, or are one of these behaviors more preferable? Thanks.


#2

The preferred way to do this with RSocket and Proteus is with the request-stream interaction model. You will subscribe to a Flux and specify the “request-n” or in other words the number of items you would like to stream. You will request a certain number of items and when you process all of those you will request another batch ie. If you want to just get items forever you can request maximum value of long or you can request something less than that and just request more when you run out.


#3

That makes total sense, thanks!