How to: Easy Caching in Elixir

preview_player
Показать описание
We are going over an easy technique to introduce a bit of state in Elixir by caching with an Agent.

💻 Pragmatic Studio’s course is the most efficient way to learn Elixir/Phoenix LiveView. Use the course that I use to teach all my apprentices:

#liveview #phoenix #elixir #software #softwaredevelopment
Рекомендации по теме
Комментарии
Автор

Is there a reason for choosing Agent over Genserver?

johnsiskmusic
Автор

This will work if you have only one node running. What do you use to manage process for setup with more than one node?

sakchais
Автор

Was the Discord stuff too much? I thought working within a real problem would make things interesting. We're curious as to whether you thought it was fun or if it was a distraction. Let us know!

liveviewmastery
Автор

I have a question, what would happen in case of parallel access? Imagine that I'm creating a new ticket at the same time that someone is closing a ticket, I think that there is a chance that someone gets the wrong information. What if instead of reseting the cache you invalidate? So when you are searching for the tickets, you would first check if the cache is valid, if not, you would fill the information. set it to valid, and return that info. What do you think?

gabrielcontra