It has taken some time, but benchee 1.0 is finally here! This release mostly removes deprecated APIs - which ones? Run the 0.99 release to find out! Other than this benchee now shows the absolute difference of the averages in the comparison - is half a millisecond really worth that much new code? Read more in the Changelog and in the release blog post.
After building dozens of products with Elixir since 2014, we open-source the boilerplate app we use to kickstart all of our projects!
This boilerplate comes with batteries included, you’ll find:
- The battle-tested production-ready web framework Phoenix
- Popular databases integration with Ecto
- Tests with ExUnit, with coverage
- Linting with Credo
- Formatting with mix format
- A Distillery setup with Docker integration
- Translations powered by Gettext
- Useful utilities for standard web server: HTTP Basic Auth, canonical host
- Error reporting with Sentry
- A clean and useful README.md template
- Clone this project (
git clone https://github.com/mirego/elixir-boilerplate.git)
- Delete the internal Git directory (
rm -rf .git)
- Run the boilerplate setup script (
- Create a new Git repository (
- Create the initial Git commit (
git commit -a -m "Initial commit")
In this free episode we’ll take a look at using the terminate callback in GenServer to gracefully shutdown.
With Java it’s possible to use processes and parallelize them but it isn’t common and it’s always a struggle. In Elixir I found another world that, citing Bruce Williams, doesn’t treat concurrency and process management like afterthoughts or advanced features. And a few months ago Elixir was updated to version 1.6 which introduced the DynamicSupervisor.
Check out the full article in our blog
Wouldn’t be great to process a large HTTP response, in chunks, with Elixir streams? Something like:
HTTPStream.get("https://.../large_image.tiff") |> StreamGzip.gzip |> Stream.into(File.stream!("image.tiff.gz")) |> Stream.run
In this first of a two-parts article, we see how to transform an HTTPoison async response into an Elixir Stream, to easily process large remote files on the fly, gaining code clarity and reusability.
When learning about Ecto, it is important to understand when to apply constraints and validations. But what are there differences? When do we need one or the other? Are there times when we want both? All of these questions can be answered on my blog post found on ElixirSchool!
Keeping state consistency while running an Elixir application on many servers.
For my project Grapevine, I start a single machine cluster using epmd. I ran into a few issues with the automatic epmd management. This post shows what issues I ran into and how I got around them.
Distributed programming isn’t the only area Elixir excels. One of the less advertised strengths of erlang’s little brother is that it contains one of the most elegant and compact ways to define binary parsers in a programming language. Code visually represents data structures making it easy to match and extract bytes and even individual bits in the function heads themselves. This capability makes Elixir an unexpected front-runner for learning and prototyping binary protocols.
Coney is a convenience library for working with RabbitMQ effectively. It supports consuming and publishing messages, working with RabbitMQ cluster and holding several connections. Now it supports to be integrated into your service’s healthcheck system!
Check it on Github
Do you have a Rails background?
Are you tired of looking at outdated or incomplete tutorials on how to build a JSON API using Elixir and Phoenix?
This won’t just be about how to generate a new Phoenix API only app. That’s easy enough, you just need to pass the —no-webpack —no-html to mix phx.new.
This tutorial is about creating a small, but fully operational JSON API for web applications.