View Source amoc_scenario behaviour (amoc v3.0.0-rc1)

Link to this section Summary

Link to this section Types

-type sourcecode() :: binary().
-type state() :: any().
-type user_id() :: pos_integer().

Link to this section Callbacks

-callback init() -> {ok, state()} | ok | {error, Reason :: term()}.
-callback start(user_id()) -> any().
-callback start(user_id(), state()) -> any().
-callback terminate(state()) -> any().

Link to this section Functions

Link to this function

does_scenario_exist(Scenario)

View Source
-spec does_scenario_exist(module()) -> boolean().
Link to this function

handle_call(_, _, State)

View Source
-spec handle_call(any(), any(), state()) -> {reply, any(), state()}.
-spec handle_cast(any(), state()) -> {noreply, state()}.
-spec init([]) -> {ok, state()}.
Link to this function

install_module(Module, ModuleSource)

View Source
-spec install_module(module(), sourcecode()) ->
                  ok | {error, [Errors :: string()], [Warnings :: string()]}.
Link to this function

list_configurable_modules()

View Source
-spec list_configurable_modules() -> [module()].
-spec list_scenario_modules() -> [module()].
-spec list_uploaded_modules() -> [{module(), sourcecode()}].
-spec remove_module(module()) -> ok | {error, [Errors :: string()], [Warnings :: string()]}.
-spec start_link() -> {ok, pid()} | ignore | {error, term()}.