View Source Hangman.Engine.GameServer (Hangman Engine v0.1.70)

A server process that holds a game struct as its state. Times out after 30 minutes of inactivity.

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Spawns a game server process to be registered via game_name.

Allows to register or look up a game server process via game_name.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

init(game_name)

@spec init(Hangman.Game.name()) :: {:ok, Hangman.Game.t(), timeout()}

Callback implementation for GenServer.init/1.

start_link(game_name)

@spec start_link(Hangman.Game.name()) :: GenServer.on_start()

Spawns a game server process to be registered via game_name.

via(game_name)

@spec via(Hangman.Game.name()) :: {:global, tuple()}

Allows to register or look up a game server process via game_name.