How to mock HTTPoison in Elixir?

In this article, I’m showing how to use MOX library to simulate HTTPoison behavior and how properly mock HTTP client in your tests.

https://k.lelonek.me/how-to-mock-httpoison-in-elixir

ExAws.CloudSearch: CloudSearch Service Module for ExAws (0.2)

ExAws.CloudSearch is a service module for AWS CloudSearch for use with ExAws.

Version 0.2 has been released. Nominally, it completes the API suite for the current version of AWS CloudSearch by providing all of the configuration APIs, a suggestion request, and document add/remove APIs.

The APIs for the configuration calls should be considered unstable; the document add/remove APIs should be considered mostly stable.

The code can be found on GitHub.

How to do Outside-In TDD with Phoenix

Elixir/Phoenix is pure functional compare to Ruby/Rails, the basic building blocks (Plugs) are just functions, which would be super easy to unit test. Though there were some blog posts demonstrating how to mock Context in ConnTest using Mox, there were almost no resources teaching how to unit test a Phoenix controller (calling controller functions directly in test cases).

This post’s main purpose is to fill that gap and explain the full TDD cycle developing a new feature.

How to do Outside-In TDD with Phoenix - dsdshome

ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.

Railsy Model Helpers for Ecto

Ecto.Rut introduces Active-Record like model helpers into Ecto schemas.

# Lets you call methods like
Post.insert!(title: "Hello World!", status: :draft, content: ".....")

# Instead of
changeset = Post.changeset(%Post{}, %{title: "Hello World!", ...})
Repo.insert!(changeset)

More Than 1:1 With Elixir's GenStage

I didn’t understand how to make GenStage’s “stages” interact with one another beyond a 1:1 ratio of events. None of the articles or documentation showed anything but the flow of the same amount of events from one stage to another (i.e. 1:1). I knew it had to be able to do more, so I set out to figure it out.

More Than 1:1 With Elixir’s GenStage

TMIB-19: This July, bors landed a fix that can help if the Installation webhook gets missed for some reason

https://bors.tech/newsletter/2018/08/01/tmib-19/

Tarearbol now allows subscriptions to task results

Tarearbol is a lightweight task manager, allowing retries, callbacks, assurance that the task succeeded, and more.

Starting with version 0.8.1 it married Envío to make it drastically easy to subscribe to task processing callbacks via Registry with pub_sub.

http://rocket-science.ru/hacking/2018/08/03/tarearbol-now-allows-subscriptions

Migrating Firebase Cloud Messaging service

I will show you how easy it is to migrate from Legacy Firebase Cloud Messaging to the new FCM HTTP v1 service!

Check article at https://appunite.com/blog/migrating-firebase-cloud-messaging

Continuous Integration with Jenkins, Docker-Compose, and Elixir

A good post by my colleague Richard on how we do CI and CD :D https://engineering.tripping.com/continuous-integration-with-jenkins-docker-compose-and-elixir-7d47439231db

ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.

[Podcast] Elixir Mix - Process and OTP pitfalls with Claudio Ortolina

In this episode of Elixir Mix, the panel talks to Claudio Ortolina about Process and OTP pitfalls. Claudio works for Erlang Solutions where he is a developer consultant, working with customers on long projects, and he has been working full-time with Elixir for the past 3 years. They talk about OTP, the importance of reading the sources when working with Elixir, and if beginners should dive right away into OTP. They also touch on Process, how Elixir allows your code to be more available, and more!

Listen to this episode and subscribe at https://devchat.tv/elixir-mix

[Podcast] Elixir Mix - Docker with Julian Fahrer

In this episode of Elixir Mix, the panel talks to Julian Fahrer about Docker. Docker is a container platform, which you can imagine as a set of tools, services, and practices that help you to develop, ship, and run your applications using software container technology. They talk about the applicability for developers for using Docker, the two different ways people use Docker, and how he usually uses Docker. They also touch on the main idea behind containers, the basics of Docker, and more!

Listen to this episode and subscribe at https://devchat.tv/elixir-mix

Making an Asynchronous Function Synchronous with GenServer.reply

https://www.annkissam.com/elixir/alembic/posts/2018/07/30/genserver-reply.html

How to implement sliding timeouts in your Elixir GenServers

https://engineering.tripping.com/how-to-implement-sliding-timeouts-in-your-elixir-genservers-cc5a2ed70db9

Persisting event data to Postgres using GenStage and EventBus

One of the ways to consume EventBus events is implementing GenStage consumers. GenStage handles backpressure easily with configurable workers. event_bus_postgres library uses GenStage to persist event_bus events to postgres DB with batch insert.

https://dev.to/mustafaturan/persisting-event-data-to-postgres-using-genstage-and-eventbus-oi9

Top Open Source Frameworks in Elixir

Elixir is an open source, functional, dynamic language with a strong emphasis on concurrency and fault tolerance. It runs on the Erlang virtual machine (BEAM). Elixir builds on top of Erlang and shares the same abstractions for building distributed, fault-tolerant applications. Check out more here Open Source Frameworks in Elixir

Elixir port of Python's langdetect

Tongue is a rework of well-known Nakatani Shuyo’s natural language detector

https://github.com/dannote/tongue

auto_doc - test proven REST API docs

auto_doc

A hex package to document your REST API that use plug. Not only does create docs for you but it also backs your docs up by using your tests. This way you can be certain that your API works because it only generates the docs if your tests are passing.

Envío as a reincarnation of GenEvent²

Envío is kinda GenEvent², the modern idiomatic pub-sub implementation of event passing.

This blog describes it’s internals, how-tos and provides an example of the built-in backend for routing messages to Slack using :pub_sub subscription type.

http://rocket-science.ru/hacking/2018/07/30/envio-as-genevent-2-0

Phoenix instrumentation with Prometheus

How to collect metrics in Phoenix with Prometheus (Ecto’s average query time, controller average response time, view render times…)

https://medium.com/@raphael.megzari/instrumenting-phoenix-with-prometheus-61dee2d5e166

Jaxon 1.0 released! with JSON path streaming, benchmarks and more

Jaxon is a JSON decoder with the default parser implemented as a NIF that can do streaming, path queries and still achieve the same or better performance as other libraries.

  • Improved API
  • Complete documentation
  • Decoupling of parsing and decoding
  • Yielding decoder that can decode partial JSON event lists
  • Add stream query functionality
  • JSON path expression parser and encoder
  • Coverage reporting via Coveralls
  • CI via Travis
  • Benchmarking

https://github.com/boudra/jaxon