-
Notifications
You must be signed in to change notification settings - Fork 10
fsm_worker
okebkal edited this page Apr 1, 2016
·
4 revisions
fsm_worker
Generic fsm_worker behaviour
role_id() =
{Role :: atom(),
RoleID :: atom(),
MiddleMan :: mm(), %% see role_worker
Flag :: true | false,
Params :: [any()]}
sm() =
#sm{id = atom(),
table = tab(),
share = tab(),
dets_share = tab_name(),
roles = [role_id()],
module = atom(),
env = #{},
state = atom(),
event = atom(),
event_params = any(),
stack = [atom()],
final = [atom()],
timeouts = [{Event :: atom(), TRef :: tref()}] %% see timer library for tref()
Types
RoleIDs = [role_id()]
Roles = atom() || [atom()]
Result = [role_id()]
The following functions must be exported from a fsm_worker callback module.
Types
ModID = atom
RoleIDs = [role_id()]
SupID = atom
Mod = atom
Fun = atom
ArgS = any()
Result = {ok,pid()} | ignore | {error,any()}
Types
ModID = atom
RoleIDs = [role_id()]
Share = tab() %% see ets library
ArgS = [any()]
Result = [sm()]