Benefits of Rx, Without the Complexity

eric at kolotyluk.net eric at kolotyluk.net
Tue Jun 21 16:09:59 UTC 2022


Thanks, Pedro, that is some good insight.

 

My experience with Akka HTTP is that it creates a Stream of Streams, where the top-level Stream accepts connections, and the child Streams process requests. This could probably be modelled nicely with Loom Virtual Threads and Structured Concurrency. Maybe someone will build an API for Loom HTTP that packages this all together the way Akka HTTP does, but without the cognitive load of Reactive programming, callbacks, etc. A nice feature of Akka Streams is that when one end is a TCP connection, backpressure employs TCP flow control…

 

I will have to investigate Go Channels…

 

Cheers, Eric

 

From: Pedro Lamarão <pedro.lamarao at prodist.com.br> 
Sent: June 21, 2022 7:42 AM
To: Eric Kolotyluk <eric at kolotyluk.net>
Cc: Brian Goetz <brian.goetz at oracle.com>; loom-dev <loom-dev at openjdk.java.net>
Subject: Re: Benefits of Rx, Without the Complexity

 

Em ter., 21 de jun. de 2022 às 10:53, <eric at kolotyluk.net <mailto:eric at kolotyluk.net> > escreveu:

 

I agree that we need to analyze the system to put the right constraints in the right places, but can this be automated more, such that it is more ‘magic’? Is anyone researching this? Not like a magic bullet, but well… I never thought cars could drive themselves… but they do…

 

Largely, I was hoping there were better ways to build systems that don’t thrash, which is appalling behaviour I have seen before, even in the systems I have built. Systems that better utilize resources by default, so we don’t have to waste resources to avoid thrashing. However, I believe Virtual Threads make better use of resources the way Virtual Memory does, so we are definitely heading in the right direction.

 

In my experience with reactive frameworks, the framework is magic only if you use predefined "sources" and "sinks" which by nature solve this problem for you.

This is like programming TCP: it does flow control for you, there is no need to worry about it.

Whenever you need to define a new source or a new sink for your custom case, reactive framework magic disappears.

In these cases, the tools to do backpressure in "reactive" and "threads" are the same: bounded atomic queues or "channels".

This concept of "channel", like Go has, is probably the magic that will complete this picture.

 

-- 

Pedro Lamarão

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20220621/ff5e213f/attachment.htm>


More information about the loom-dev mailing list