Empex 2016 Meetup Recap
In May 2016, I attended Empex, the first (annual, let’s hope) Elixir conference in NYC (called Empex). It was a one day conference full of great talks about Elixir, Phoenix, and Erlang. I am presenting a recap at a local meetup this month, and tracking my notes here.
Keynote with Bruce Tate
Bruce Tate is a cool guy. He talked a lot about how we progressed from Java, to Ruby and now onto Elixir and Erlang.
Years ago he was on a train with Dave Thomas and talking about not getting ruby, to which a rarely frustrated Dave says “Shut up and do something nontrivial in ruby, and then we can talk”.
Another word that I may or may not have heard of was QWAN or Quality With a Name. In particular, language making in seeking QWAN.
Async Jobs in Elixir with George Guimarães
Avoid it. If the task dies it brings down the caller too.
Familiar pattern that is used throughout most libs. You create your supervisory tree as follows (and it can be nested and complex if you like)
children = [
supervisor(Task.Supervisor, [[name: Backyard.Spreadsheet.ImporterSupervisor]]),
To start off your supervisor,
Spreadsheet.Importer, :start, [file]
Smart defaults include
Useful for things like
- spreadsheet importer
- image resize
- counter cache
For deployment, consider using
shutdown: :brutal_kill (or :infinity, 5_000)
Be weary of external resources and consider restraining your code to avoid overwhelming those services (e.g. poolboy).
This provides a GenServer as a EventManager and is suitable when you want to limit the number of running processes in the pool; also supports retry if those services fail
If you need a bit more persistence around your processes then look at using an external queue such as verk (job processor backed by redis). It has a great user interface for watching workers. Another option is nats, another message broker meant to be much simpler than say kafka or rabbitmq.
Your First Package with Brian Cardarella
Make sure to provide sensible values in your mix.exs and WTFM
def project do
elixir: “~> 1.2”,
description: "Lots of crazy pants",
Look at the following packages to help
Create them locally
For more advanced, take a look at Typespec
@spec drop(binary) :: binrary
def drop(location) do
And use dialyxir for contract enforcement
CodeGen In Elixir
- Concurrency + Distribution = Scalability + Availability, a journey architecting Systems on BEAM
- Async Jobs in Phoenix
- The Climb — Experiencing the Rise of Elixir from the Inside
- Giving back, building your first package
- Real World Elixir Deployment
- Letting the Phoenix Fly in Production
- A Journey To The Center Of The BEAM
- Micropatterns: Learning to reach quickly for the right tool
- The Journey to Elixir In Production At Scale
- Code Generation in Elixir