Reactive in Elixir

In my early talks about data flows and parallel processing in Elixir, Rx was constantly mentioned as a reference. The goal was to have functions that introduce state or asynchronicity in the Stream module. But in order to have async or state, we need processes and then we need to think about supervision trees. At some point it became clearer Rx/Stream was not the way to go and we focused more directly on what became GenStage today. Unless I am mistaken, I briefly explored those topics in ElixirConf EU 2015 (in Krakow).

When going from Streams to Flows in Elixir, we are going from lazy+purely functional to async+parallel. There is definitely a gap in there, which are collections that are async or stateful but not yet parallel. That’s where Rx would fit in.

While I am not confident it is a gap worth exploring, given we have Streams and Flows at the boundaries, an Rx like system could (should?) be implemented using GenStage, as it would transparently handle most the data exchange concerns.

9 Likes