Packages

Provides random words from a list of 5,000 most common American English words. Can break them down into parts-of-speech. Fun for party tricks, example strings, and random names.

Current section

Files

Jump to
random_words lib word_supervisor.ex
Raw

lib/word_supervisor.ex

defmodule RandomWords.WordSupervisor do
@moduledoc """
Restart WordServer if there's a problem.
"""
def start_link(opts \\ []) do
Supervisor.start_link(__MODULE__, :ok, opts)
end
def init(:ok, _opts \\ []) do
children = [
{RandomWords.WordServer, name: RandomWords.WordServer}
]
Supervisor.init(children, strategy: :one_for_one)
end
end