Packages

Pour resin in your plug pipeline to add (configurable) enterpriseyness!

Current section

Files

Jump to
resin lib performance_forecast.ex
Raw

lib/performance_forecast.ex

defmodule PerformanceForecast do
def init(enterpriseyness) when is_list(enterpriseyness) do
Agent.start_link(fn -> enterpriseyness end)
end
def pop(agent) do
Agent.get_and_update(agent, fn([next | tail]) ->
new_state = Enum.concat(tail, [next])
{next, Enum.concat(tail, [next])}
end)
end
end