Elixir learnings - 2020 week 5

January 27, 2020


Map.get defaults

Something small, but I realized that you can pass in a default to Map.get in case the key you're looking for doesn't exist.


I also discovered that you can use reduce_while which allows you to reduce on an enumerable collection until a criteria is met.


Automatic node discovery

My current place of work is using peerage for automatic erlang node discovery in k8s. This library makes it possible to have multiple k8s nodes that are sharing a network to automatically discover each other and connect. See also libcluster and horde for similar automatic node discovery libraries.


  1. Map.get
  2. Enum.reduce_while

© 2023, Built with ❤️ by Blake Dietz