Resin

Introduce a configurable delay to all requests in a plug pipeline.

Summary

act_enterprisey(opts \\ [])

Pour some resin in your plug pipeline

call(conn, options)

Callback implementation of Plug.call/2

init(options \\ [])

Callback implementation of Plug.init/1

Functions

call(conn, options)

Callback implementation of Plug.call/2.

init(options \\ [])

Callback implementation of Plug.init/1.

Macros

act_enterprisey(opts \\ [])

Pour some resin in your plug pipeline.

Resin.act_enterprisey will insert itself into your pipeline, unless you compiled your project with MIX_ENV=prod, and add a configurable delay to every request.

The default delay is set to 3000 ms.

If you want a shorter (or longer (really?)) delay, you can use the enterpriseyness option to set the configured delay in milliseconds, like so:

Resin.act_enterprisey enterpriseyness: 4711

When compiling with MIX_ENV=prod, this macro will do nothing. You only want to display the enterpriseyness during your demo, right?