mogs v0.1.1 Mogs.Board behaviour
Link to this section Summary
Functions
Options
Board
:load_mode
– Allowed values are:sync
and:async
. Sets wether theload/2
callback will be called during the board server initialization (:sync
) or after initialization. Defaults to:sync
.
Services
Those options allow to define the generated modules or services associated to a board module. If a module would be generated, the option sets both the module name and the process registration name.
Link to this section Types
Link to this section Functions
Options
Board
:load_mode
– Allowed values are:sync
and:async
. Sets wether theload/2
callback will be called during the board server initialization (:sync
) or after initialization. Defaults to:sync
.
Services
Those options allow to define the generated modules or services associated to a board module. If a module would be generated, the option sets both the module name and the process registration name.
Setting an option to false
or nil
will disable the corresponding
feature and no module will be generated during compilation and/or no
process will be started nor registered during runtime.
:supervisor
– The name for a generatedSupervisor
module that will supervise other components (such as registry, servers supervisor). Defaults to__MODULE__.Supervisor
.:registry
– The registration name for theRegistry
ofMogs.Board.Server
processes handling boards. Defaults to__MODULE__.Server.Registry
.:server_sup
– The name for the generatedDynamicSupervisor
module that will supervise eachMogs.Board.Server
server process. Defaults to__MODULE__.Server.DynamicSupervisor
.
Link to this function
add_player(name_or_pid, player_id, data, pid)
Link to this function
read_state(name_or_pid, fun)
Link to this function
send_command(name_or_pid, command)
Link to this function
start_server(module, supervisor, id, opts)
Link to this function
track_player(name_or_pid, player_id, pid)
Link to this section Callbacks
Link to this callback
handle_add_player(board, player_id, data)
Link to this callback
handle_player_timeout(board, player_id)
Link to this callback
handle_update(board)
Link to this callback