absowoot
Global state from a sticky liveview?
I’ve read numerous threads on the forum about maintaining a global state and it appears that the consensus is to utilize ETS ala Cachex, Phoenix Live Session, etc. Before I head down that road, I wanted to see if anyone has tried handling global state with a sticky liveview.
I think I could use on_mount to send a message to a sticky liveview, which then responds back with data, but I’m unsure how to obtain the sticky liveview PID to send the request to once it has already been loaded. Perhaps this could be stored in a session (server or client-side) or is there a a Liveview function to see all liveviews for a session?
Are there security concerns that would need to be considered?
First Post!
benwilson512
Perhaps you’re using this in a way that is different from what I understand but I don’t see how this is makes sense. If you have multiple connected liveviews, which is the source of truth? What if that source goes away and is never seen again?
What sort of state are you working with and what do you mean by “global”?
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









