View Source Hangman.Dictionary.WordsAgent (Hangman Dictionary v0.1.48)
An agent process that loads a list of words from configured external files.
Summary
Functions
Returns a specification to start this module under a supervisor.
Refreshes the agent state from the configured external files.
Spawns an agent process that loads a list of words from external files.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec refresh() :: :ok
Refreshes the agent state from the configured external files.
@spec start_link(term()) :: Agent.on_start()
Spawns an agent process that loads a list of words from external files.
Examples
iex> alias Hangman.Dictionary.WordsAgent
iex> {:error, {:already_started, agent}} = WordsAgent.start_link(:ok)
iex> is_pid(agent) and agent == Process.whereis(WordsAgent)
true