defmodule Dictionary.Runtime.Server do alias Dictionary.Impl.Words @agent_name __MODULE__ use Agent def start_link(_) do Agent.start_link(&Words.word_list/0, name: @agent_name) end def get_random() do Agent.get(@agent_name, &Words.generate_random/1) end end