CptnKirk

CptnKirk

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.

Showing Posts 1 to 8

aseigo

aseigo

I don’t believe such a thing has kicked off, no. While there are more libraries using GenStage and Flow over time, a coordinated collection of useful GenStage modules does not exist, at least afaik.

It would be awesome to start it though! :slight_smile:

CptnKirk

CptnKirk OP

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.

aseigo

aseigo

I think it is equal parts “GenStage is relatively new” and that the Elixir community tends to, at least currently, have a purpose-specific-module-centric view for development and collaboration. Nothing that can’t be improved though :slight_smile:

Flow already exists that does some of this. IMHO it would make sense to make use of that, and continue to extend it in the areas it is still lacking.

The rest I agree with .. let’s see ..

CptnKirk

CptnKirk OP

Looping back on this…

A major limitation of Flow as I see it today is the inability to structure flows as a graph of arbitrary GenStages. Flow provides a DSL for certain things today. But outside of this box, there doesn’t appear to be an easy way to get an ecosystem of 3rd party GenStages to work together.

A via(flow, producer_consumer_stage) function would go a long way I think. At least for linear flows. Fanout/fanin would still need to be addressed.

Is construction of arbitrary GenStage flow graphs something Flow is wanting to support?

OvermindDL1

OvermindDL1

Well that sounds like you should make or PR it! ^.^

CptnKirk

CptnKirk OP

I’m sort of thinking along those lines. However, I’m still an Elixir noob. So if the Elixir team is going to incorporate this into Flow for me, I’ll focus on useful GenStages and stay out of the framework core for now. If the Flow maintainers don’t think this is a fit for Flow, then I won’t go to the effort of trying to come up with a PR.

But yea…I’d like something like this. And I think that others would too. I see things like Raxx, StructureIO, and possibly others begging to participate in a well thought out streaming ecosystem.

Let’s see what the feedback is like. That’ll determine next steps.

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.

CptnKirk

CptnKirk OP

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.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews