asobi_match_lobby (asobi v0.72.5)
View SourceDiscovery for live matches.
GET /api/v1/matches reads the asobi_match_record table: finished
matches, an audit trail, nothing a player can join. This module enumerates
the running asobi_match_server processes instead, which is what a client
choosing a match actually needs.
Matches are unlisted by default. A match spawned by the matchmaker is
already assigned to its players and has no reason to appear in a browser,
so a mode opts in with listed => true. This is the inverse of worlds,
which default to listed because their browser already shipped.
Summary
Functions
List live matches. Unfiltered - callers that serve clients want list_matches/1.
List live matches with optional filters: mode, has_capacity, listed.
Cached list_matches/1 for request paths, mirroring
asobi_world_lobby:list_worlds_cached/1.
Functions
-spec list_matches() -> [map()].
List live matches. Unfiltered - callers that serve clients want list_matches/1.
List live matches with optional filters: mode, has_capacity, listed.
Only waiting and running matches are returned; a finished match is
history and a paused one cannot be joined.
Cached list_matches/1 for request paths, mirroring
asobi_world_lobby:list_worlds_cached/1.
Each uncached call issues one gen_statem:call per live match. That cost
is paid even when every match is unlisted and the result is empty, so a
flood of match.list messages would stall every match's mailbox. Keyed on
has_capacity only - mode is client-controlled and unbounded, so keying
on it would miss on every request and grow the table without bound.