Hi everyone. I’m kind of new to the community and I just developed a small prototype for an internal system using phoenix. It’s just a bunch of CRUDs with a some business logic, and the docs made it really easy to build everything, but something is bugging me. At no point in the process I really had to think of OTP and the whole Elixir model. I normally start to learn by doing and dive into the concepts when they are needed, but it didn’t work in this case. My question is, did I just ignore some patterns I don’t know that I could have used, or does Phoenix really abstract away the OTP part for simple projects?
It abstracts a lot and You don’t need to learn OTP to use Phoenix.
But it’s everywhere, and liveview is a gen_server under the hood, so You can learn how to send messages from it.
If You have it activated, You can use :observer.start to see all the processes running, from the console.
Don’t forget to update extra_applications in mix.exs to run it, like this…
extra_applications: \[ :logger, :runtime_tools, :observer, :wx \]
Welcome to Elixir
Got it. Thanks, I feel welcome
Phoenix hides a lot, but it’s there if you squint. As mentioned above, a LiveView is a GenServer and some of that leaks through (like the handle_info callbacks). LiveView’s async assigns make use of tasks and supervisors to perform work asynchronously and then send the result back as a message.
OTP really comes into play if you embrace the ecosystem. If you use a library like Cachex, for example, which builds on OTP to provide a Redis-like KV store. Or Phoenix’s own PubSub, which essentially provides fanout for message passing. What’s special about the BEAM is that all of these things can exist within the same runtime, built on top of the same abstractions.




















