Packages

Defines a behavior to be implemented for managing data that should be held in the VM and periodically refreshed.

Current section

Files

Jump to
cache_worker lib test_worker.ex
Raw

lib/test_worker.ex

defmodule TestWorker do
@moduledoc """
A simple cache worker for testing with
"""
use CacheWorker, bucket: :test_worker
def init(_) do
{:ok, %{seeded: "on init"}}
end
def load(:crash) do
raise "AAAAAAHHHHH"
end
def load(input) do
{:ok, "The value for #{input}"}
end
end