asobi_matchmaker (asobi v0.35.4)

View Source

The matchmaking queue. Players submit tickets with a mode and property constraints (add/2); a pluggable strategy groups compatible tickets, spawns a match, and pushes match.matched to each player. A single gen_server owns the queue and ticks it on an interval.

Summary

Functions

add(PlayerId, Params)

-spec add(binary(), map()) -> {ok, binary()}.

get_queue_stats()

-spec get_queue_stats() -> {ok, map()}.

get_ticket(TicketId)

-spec get_ticket(binary()) -> {ok, map()} | {error, not_found}.

get_ticket(PlayerId, TicketId)

-spec get_ticket(binary(), binary()) -> {ok, map()} | {error, not_found | not_owner}.

handle_call/3

-spec handle_call(term(), gen_server:from(), map()) -> {reply, term(), map()}.

handle_cast(Msg, State)

-spec handle_cast(term(), map()) -> {noreply, map()}.

handle_info/2

-spec handle_info(term(), map()) -> {noreply, map()}.

init/1

-spec init([]) -> {ok, map()}.

remove(PlayerId, TicketId)

-spec remove(binary(), binary()) -> ok | {error, not_found | not_owner}.

start_link()

-spec start_link() -> gen_server:start_ret().

terminate(Reason, State)

-spec terminate(term(), map()) -> ok.