Hi everyone! I’m new to elixir and phoenix and I’ve been reading lots of documentation lately for a feature I have to implement.
Anyways, I have a dashboard of sorts that needs to be updated real time instead of having to reload the site to have the latest data. I’ve seen various ways of doing this, sometimes with a PubSub, others with Channels, other times with Streams and also with callbacks but I don’t know which one is the better practice, I guess it depends as there are trade-offs for each method.
I currently have a live_session of the LV page and the data is first fetched on the mount callback and then rendered but there no other callbacks involved. There’s also a periodical process that is called to get data but this isn’t connected to the LV and I thought maybe it could be used to trigger a re-render using send but I’d have to somehow get the LV’s pid to the periodical function from what I’ve read here.
I’m kinda stuck between all these alternatives atm, pls help.