Skip to main content

Module streams

Module streams 

Source
Expand description

NDJSON streams: a player’s event stream, a game’s board/bot stream and the public move stream.

Each stream is a task writing lines into a channel; it ends when the client goes (a send fails) or, for a game, when the game is over. Changes reach every replica through Postgres notifications; a stream reloads the game from the database on each one, so it never relies on a note’s contents for state.

Functions§

board_game
bot_game
events
moves