Erynn

Erynn

suppose genstage have one producer and many consumer for push notification in a chat application and each consumer subscribe that one producer. now tell me, after subscribing that single producer, consumer will ask notification from producer. how producer will send my group notification because all group are sending notifications to only that single producer?

Showing Posts 1 to 6

kokolegorille

kokolegorille

I think notifications does not have the same meaning here…

In Genstage, the demand comes from the consumer, the producer is just delivering data. It never goes the other way around.

Erynn

Erynn OP

see this blog, in this blog they say they have one producer per machine and many consumers and consumer subscribe certain producer and when consumer receive this handle_subscribe then consumer use GenStage.ask and when producer receive in handle_demand, it do nothing according to blog.

suppose in a chat system when a channel have to send notification it use this GCM.PushCollector.push function to send to producer and then in handle_cast, it send to all subscriber consumers.

now i want to know how producer determing which notification it have to send to which consumer, if it send all notifications to all subscribe consumers then it will increase overload?

LostKobrakai

LostKobrakai

There is no such thing for the producer. The producer cannot select which consumer will handle an event. However the dispatcher behaviour might be able to route events to certain consumers: GenStage.BroadcastDispatcher — gen_stage v1.3.2

This will make things more complicated as back pressure will still be applied globally. So if one specific type of event slows down I think processing of all events will slow down. Even if not the other option would be a growing buffer in the dispatcher, which also eventually becomes a problem.

Erynn

Erynn OP

ok give me solution,

in discord blog it says, one producer per machine that means many consumers subscribe same producer.

then how discord producer send notifications to certain consumer if producer does not filter according to blog(i mean how discord producer rotate notification to crrtain user)?

LostKobrakai

LostKobrakai

That expects they require a certain consumer to handle the notification in the first place. At best the genstage consumers don’t care which notification they handle – they just handle whatever they get. Looking at the blog post that seems to be the case for discord as well.

Erynn

Erynn OP

one last question,

if i am member of 25 groups then i should have to start 25 consumers?

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

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
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews