Cauldron2D.Arenas.Sweeper (Cauldron2D v0.1.3)

Copy Markdown View Source

Stops arenas that have had no human in them for a while; they start again on the next use of their world's name. Each sweep also seats the children a running arena is short of (Cauldron2D.Arenas.reseat/1).

Cauldron2D.Arenas.Sweeper.start_link(idle_after: 120, every: 30)

Options

  • :idle_after — seconds without a human before an arena is stopped. Default 120
  • :every — seconds between sweeps, or :never to sweep only on sweep/1. Default 30
  • :name — the process name. Default the module, nil for none

Summary

Functions

Returns a specification to start this module under a supervisor.

Start the sweeper.

Sweep now: seat missing children, note which running arenas are without humans and stop those idle long enough.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Start the sweeper.

sweep(sweeper \\ __MODULE__)

@spec sweep(GenServer.server()) :: :ok

Sweep now: seat missing children, note which running arenas are without humans and stop those idle long enough.