<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-CA link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Thanks, Pedro, that is some good insight.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>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…<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>I will have to investigate Go Channels…<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Cheers, Eric<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> Pedro Lamarão <pedro.lamarao@prodist.com.br> <br><b>Sent:</b> June 21, 2022 7:42 AM<br><b>To:</b> Eric Kolotyluk <eric@kolotyluk.net><br><b>Cc:</b> Brian Goetz <brian.goetz@oracle.com>; loom-dev <loom-dev@openjdk.java.net><br><b>Subject:</b> Re: Benefits of Rx, Without the Complexity<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Em ter., 21 de jun. de 2022 às 10:53, <<a href="mailto:eric@kolotyluk.net">eric@kolotyluk.net</a>> escreveu:<o:p></o:p></p></div><div><div><p class=MsoNormal> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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’? <i>Is anyone researching this?</i> Not like a magic bullet, but well… I never thought cars could drive themselves… but they do…<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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 <i>by default</i>, 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.<o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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.<o:p></o:p></p></div><div><p class=MsoNormal>This is like programming TCP: it does flow control for you, there is no need to worry about it.<o:p></o:p></p></div><div><p class=MsoNormal>Whenever you need to define a new source or a new sink for your custom case, reactive framework magic disappears.<o:p></o:p></p></div><div><p class=MsoNormal>In these cases, the tools to do backpressure in "reactive" and "threads" are the same: bounded atomic queues or "channels".<o:p></o:p></p></div><div><p class=MsoNormal>This concept of "channel", like Go has, is probably the magic that will complete this picture.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><p class=MsoNormal>-- <o:p></o:p></p><div><div><div><p class=MsoNormal>Pedro Lamarão<o:p></o:p></p></div></div></div></div></div></body></html>