CptnKirk

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

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

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

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.

Where Next?

Popular in Questions Top

bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New

Other popular topics Top

William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New

We're in Beta

About us Mission Statement