Shooting Yourself in the Foot with GenServers

Elixir’s GenServers are great. Their fault tolerance makes them a natural choice for situations where you need to store some state over time in a resilient way. They’re not without their gotchas, though. In particular, it’s quite easy to fall into traps with respect to scheduling work within the GenServer's process. Consider this toy example: … Continue reading Shooting Yourself in the Foot with GenServers

A look inside X-Plane’s massive multiplayer server

This morning I published a blog post on the X-Plane Developer blog titled "Have You Heard the Good News About Elixir?". It's a look at the requirements and goals that drove me to choose Elixir for X-Plane's massive multiplayer game server, with a look at both the pros and cons of that choice. This post … Continue reading A look inside X-Plane’s massive multiplayer server

The fastest way to iterate a Map’s values in Elixir

Say you have an Elixir Map. What's the fastest way to iterate the values? The candidates to consider are: Use Enum.map/2 and just pick out the values, ignoring the keyUse Map.values/1 and pipe the resulting list into Enum.map/2 I put together the following Benchfella microbenchmark: defmodule BasicBench do use Benchfella @test_map Map.new(1..10_000, fn k -> … Continue reading The fastest way to iterate a Map’s values in Elixir