asobi_match_server (asobi v0.35.4)
View SourcePer-match gen_statem driving the configured game module.
Trust boundary (F-32): asobi is single-tenant by design. The
configured game module (Mod:join/2, Mod:tick/1, Mod:handle_input/3,
phase / vote callbacks, etc.) is trusted code. We do not wrap
callbacks in try/catch — a crash in the game module is treated as a
bug worth surfacing, not a security boundary to harden against. The
match supervisor restarts the match server up to 10 times in 60s
(transient + intensity 10) before the entire asobi_match_sup falls
over, intentionally taking the lobby with it so an obviously broken
game cannot keep churning silently.
In multi-tenant or sandboxed contexts (asobi_lua) callbacks are run
through a Lua sandbox that has its own fault-isolation; that wrapper is
the place to put callback hardening.
Summary
Functions
-spec callback_mode() -> gen_statem:callback_mode_result().
-spec cancel(pid()) -> ok.
-spec finished(gen_statem:event_type() | enter, term(), map()) -> gen_statem:state_enter_result(atom()).
-spec paused(gen_statem:event_type() | enter, term(), map()) -> gen_statem:state_enter_result(atom()).
-spec running(gen_statem:event_type() | enter, term(), map()) -> gen_statem:state_enter_result(atom()).
-spec start_link(map()) -> gen_statem:start_ret().
-spec waiting(gen_statem:event_type() | enter, term(), map()) -> gen_statem:state_enter_result(atom()).