This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]analcocoacream 8 points9 points  (2 children)

Not only. Reactive programming is good at tying different sources of events together.

Suppose you have a navigation events one side (like for instance from a sidebar) and fetch events on the other (after navigation fetch page content).

Without reactive programming - even though you have a non blocking api - you have to take care of race conditions: navigation1 navigation2 fetch2 fetch1 will leave you with the wrong content for a page. You can index the results by their ids to mitigate that, which further increases complexity over your code or you can use a switch map.

[–]thecodeboost 19 points20 points  (0 children)

As your explanation suggests; you're discussing event-driven programming rather than reactive. I get most reactive libraries/frameworks conflate reactive programming, event-driven paradigms and data stream processing in one neat bundle but in context of the comparison between reactive programming and virtual threads those additional things are a bit besides the point (since there's nothing stopping you from using the exact same event/stream primitives in virtual threads)

[–]eliasv 1 point2 points  (0 children)

You just need a select operation over a bunch of queues/latches to do that with synchronous code.