ssss

ssss

Process events that depends on each other - Flow

Hello, I successfully implemented the whole GenStage & Flow thingy, it is really awesome, so I want to continue with it for the next job:

Imagine you have a variable number of events (let’s say in chunks of 30s). They need to know about the past(-30s) and the future events (+30s) in order to be correctly parsed.
So first batch contains 90s worth of events (“past”, “to be parsed” and “future”).
Second batch contains the ( “to be parsed” as past, “future” is now present and new 30s that are the future)
etc…

The problem i found is I’m not able to tell Flow that he has all the events needed to execute on_trigger/, as far as I know, I need the event count(variable) or the timestamp (there is overlapping) or the executing time (again, variable)

I also tried to “hack it” by setting a count=1 for the window and send it all the needed events at once by sending [events]. But then, in the consumer, I’m not able to do something like real_events = List.first(events) before the pipeline starts.

This can be done using Flow? if so, any tips?. Thanks a lot! I’m really struggling with this one :blush:

First Post!

dimitarvp

dimitarvp

My GenStage and Flow are extremely rusty so I can’t help you directly. But I have to ask: do you need the back pressure mechanisms?

If not, what you need can be achieved with Stream and Task.async_stream relatively easily.

Where Next?

Popular in Questions Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
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
LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
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
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New

Other popular topics Top

josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
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
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
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
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement