session

Types

pub type Message {
  Join(String)
  Set(GameState)
  Close
  GetPlayers(Subject(List(String)))
  GetGame(Subject(Option(GameState)))
}

Constructors

  • Join(String)
  • Set(GameState)
  • Close
  • GetPlayers(Subject(List(String)))
  • GetGame(Subject(Option(GameState)))

Functions

pub fn close(subject: Subject(Message)) -> Nil
pub fn get_game(subject: Subject(Message)) -> Option(GameState)
pub fn get_players(subject: Subject(Message)) -> List(String)
pub fn join(subject: Subject(Message), name: String) -> Nil
pub fn start(name: String) -> Result(Subject(Message), StartError)
pub fn start_link(name: String) -> Result(Pid, Dynamic)
pub fn update(subject: Subject(Message), game: GameState) -> Nil
Search Document