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

JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
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
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
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
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
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

Tee
can someone please explain to me how Enum.reduce works with maps
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
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
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
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
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement