apologiesserver.config

System configuration.

Module Contents

apologiesserver.config.DEFAULT_CONFIG_PATH
apologiesserver.config.DEFAULT_LOGFILE_PATH = None
apologiesserver.config.DEFAULT_SERVER_HOST = 'localhost'
apologiesserver.config.DEFAULT_SERVER_PORT = 8080
apologiesserver.config.DEFAULT_CLOSE_TIMEOUT_SEC = 10
apologiesserver.config.DEFAULT_WEBSOCKET_LIMIT = 1000
apologiesserver.config.DEFAULT_TOTAL_GAME_LIMIT = 1000
apologiesserver.config.DEFAULT_IN_PROGRESS_GAME_LIMIT = 25
apologiesserver.config.DEFAULT_REGISTERED_PLAYER_LIMIT = 100
apologiesserver.config.DEFAULT_WEBSOCKET_IDLE_THRESH_MIN = 2
apologiesserver.config.DEFAULT_WEBSOCKET_INACTIVE_THRESH_MIN = 5
apologiesserver.config.DEFAULT_PLAYER_IDLE_THRESH_MIN = 15
apologiesserver.config.DEFAULT_PLAYER_INACTIVE_THRESH_MIN = 30
apologiesserver.config.DEFAULT_GAME_IDLE_THRESH_MIN = 10
apologiesserver.config.DEFAULT_GAME_INACTIVE_THRESH_MIN = 20
apologiesserver.config.DEFAULT_GAME_RETENTION_THRESH_MIN = 2880
apologiesserver.config.IDLE_WEBSOCKET_CHECK_PERIOD_SEC = 120
apologiesserver.config.IDLE_WEBSOCKET_CHECK_DELAY_SEC = 300
apologiesserver.config.IDLE_PLAYER_CHECK_PERIOD_SEC = 120
apologiesserver.config.IDLE_PLAYER_CHECK_DELAY_SEC = 300
apologiesserver.config.IDLE_GAME_CHECK_PERIOD_SEC = 120
apologiesserver.config.IDLE_GAME_CHECK_DELAY_SEC = 300
apologiesserver.config.OBSOLETE_GAME_CHECK_PERIOD_SEC = 300
apologiesserver.config.OBSOLETE_GAME_CHECK_DELAY_SEC = 300
apologiesserver.config.DEFAULTS
class apologiesserver.config.SystemConfig

System configuration.

logfile_path

The path to the log file on disk

Type:

str

server_host

The hostname to bind to

Type:

str

server_port

The server port to listen on

Type:

int

close_timeout_sec

The maximum amount of time to wait when closing a connection

Type:

int

websocket_limit

Limit on the number of websocket connections

Type:

int

total_game_limit

Limit on the total number of tracked games

Type:

int

in_progress_game_limit

Limit on the number of in progress games

Type:

int

registered_player_limit

Limit on the number of registered players

Type:

int

websocket_idle_thresh_min

Number of minutes of no activity before a websocket with no players is considered idle

Type:

int

websocket_inactive_thresh_min

Number of minutes of no activity before a websocket with no players is inactive

Type:

int

player_idle_thresh_min

Number of minutes of no activity before a player is considered idle

Type:

int

player_inactive_thresh_min

Number of minutes of no activity before a player is considered inactive

Type:

int

game_idle_thresh_min

Number of minutes of no activity before a game is considered idle

Type:

int

game_inactive_thresh_min

Number of minutes of no activity before a game is considered inactive

Type:

int

game_retention_thresh_min

Number of minutes to retain data about games after they are completed

Type:

int

idle_websocket_check_period_sec

Number of seconds to wait between executions of the Idle Websocket Check task

Type:

int

idle_websocket_check_delay_sec

Number of seconds to delay before the first Idle Websocket Check task

Type:

int

idle_player_check_period_sec

Number of seconds to wait between executions of the Idle Player Check task

Type:

int

idle_player_check_delay_sec

Number of seconds to delay before the first Idle Player Check task

Type:

int

idle_game_check_period_sec

Number of seconds to wait between executions of the Idle Game Check task

Type:

int

idle_game_check_delay_sec

Number of seconds to delay before the first Idle Player Check task

Type:

int

obsolete_game_check_period_sec

Number of seconds to wait between executions of the Obsolete Game Check task

Type:

int

obsolete_game_check_delay_sec

Number of seconds to delay before the first Idle Player Check task

Type:

int

logfile_path: str | None = None
server_host: str = 'localhost'
server_port: int = 8080
close_timeout_sec: int = 10
websocket_limit: int = 1000
total_game_limit: int = 1000
in_progress_game_limit: int = 25
registered_player_limit: int = 100
websocket_idle_thresh_min: int = 2
websocket_inactive_thresh_min: int = 5
player_idle_thresh_min: int = 15
player_inactive_thresh_min: int = 30
game_idle_thresh_min: int = 10
game_inactive_thresh_min: int = 20
game_retention_thresh_min: int = 2880
idle_websocket_check_period_sec: int = 120
idle_websocket_check_delay_sec: int = 300
idle_player_check_period_sec: int = 120
idle_player_check_delay_sec: int = 300
idle_game_check_period_sec: int = 120
idle_game_check_delay_sec: int = 300
obsolete_game_check_period_sec: int = 300
obsolete_game_check_delay_sec: int = 300
to_json() str

Serialize to JSON.

apologiesserver.config.load_config(config_path: str | None = None, overrides: dict[str, Any] | None = None) None

Load global configuration for later use, applying defaults for any value that is not found.

apologiesserver.config.config() SystemConfig

Return system configuration.