CptnKirk
GenStage eye for the Akka Streams guy?
I’m coming from a Scala and Akka Streams background. Elixir GenStage and Flow seem familiar and attractive. What I seem to be missing is the GenStage ecosystem and some off the shelf sources.
For example, I’d like to write a streaming socket duplicator. Take a TCP producer and broadcast binaries to multiple consumer pipelines.
Where is the high-quality TCP/UDP GenStage Producer (I see File IO support, but not network)?
Is there an explicit implementation of a “buffer” stage that supports various overflow strategies similar to (http://doc.akka.io/docs/akka/2.5.3/scala/stream/stream-rate.html#buffers-in-akka-streams)?
Is there a connector ecosystem similar to http://developer.lightbend.com/docs/alpakka/current/?
Thanks for any help/tips/pointers.
Most Liked
CptnKirk
I agree with that. I’ve been on the JVM for a long time. But for my next project, the JVM is going to be too heavyweight. So I’m looking at BEAM. OTP and Erlang inspired so much within Scala and Akka that I’m hoping to feel at home here. So far, so good, and the community is amazing.
Elixir has been inspired by the reactive-streams processing model. GenStages seem to be a decent analog to RS Publisher/Subscriber. What Elixir is missing are the higher-level toolkits akin to RxJava2, Akka Streams, etc. Flow exists but isn’t as mature as Akka Streams.
The question is how to mature reactive streams within the Elixir community? Do we attempt to mature Flow? Have a few companies/projects roll their own abstractions on top of GenStage? Anything would be better than nothing. I’m just trying to decide where to focus my energies.
On the JVM, a leading web framework has been leveraging Akka Streams as its base processing architecture for a while and has recently transitioned to Akka HTTP for request handling. Whether you pick Akka Streams or a different reactive-streams compliant library you end up with a solid processing model and interoperability between libs built on top of the RS SPI. Elixir could have that too.
CptnKirk
Bummer that more foundational stages don’t exist yet. An Elixir provided TCP producer stage seems like something that ought to be standard with this concept.
I’d be willing to contribute to a coordinated collection or an umbrella project that seeks to unify quality stage implementations, high-level flow API as well as eventually a graph API. But I don’t have the time to lead such an effort. Is that something the Elixir guys could coordinate?
The community has been amazing thus far. It even seems that the Witchcraft folks are working on a graph DSL, albeit not for GenStages explicitly. I’ve no doubt that the community can collect some amazing building blocks if they were coordinated.
You’ll need a:
- Site dedicated to “Reactive Elixir” or whatever buzzword you want.
- Codebase for developers to submit PRs against.
- Collection of foundational stages.
- Higher level stage abstractions, like Flow and Graph. (include the ability to delegate the constructing of physical stages from Flow/Graph descriptions – this will allow for optimizations such as stage fusion where a single stage handles a process chain, avoiding message passing overhead)
- Tutorials showing many examples and cookbooks for solving common problems.
Elixir has already borrowed concepts from Reactive Streams and the Akka community. Borrow this too. It will take proper stream-based programming on Elixir to the next level. It may even drive language adoption. Since there would be a clear path for those looking to move from the JVM to BEAM using familiar methodologies.
mkunikow
I can be brutal but I would say that you don’t find anything more mature in any language than Java Reactive Streams implementations http://www.reactive-streams.org/
like RxJava2, Akka Streams … and what is great that RxJava2 can talk to Akka Streams as they both implements reactive streams.







