session

Types

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

Constructors

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

Functions

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