heimdall v0.6.8 Heimdall.Util.PlugUtils

Module for working with plugs.

Plug has a lot of nice features, but unfortunately many of them do their work at compile time. These utils are for when more tools are need to work with plugs.

Summary

Functions

Wraps a plug around another plug, returning a new function plug. Parameters can be function plugs, module plugs, or a mix of the two

Reduces a list of plugs to a single function plug. Wraps the plugs such that the left most plug in the list is first plug to be called

Macros

Macro that expands to a case statement which check whether or not and expression should be evaluated. The use case for this is to prevent plugs from being called if a conn is halted

Functions

wrap_plug(current, next)

Wraps a plug around another plug, returning a new function plug. Parameters can be function plugs, module plugs, or a mix of the two.

wrap_plugs(plugs, last)

Reduces a list of plugs to a single function plug. Wraps the plugs such that the left most plug in the list is first plug to be called.

Macros

check_conn(conn, list)

Macro that expands to a case statement which check whether or not and expression should be evaluated. The use case for this is to prevent plugs from being called if a conn is halted.