View Source amoc_scenario behaviour (amoc v3.3.0)
Summary
Callbacks
start/2 is preferred over start/1. At least one of them is required.
terminate/1 is preferred over terminate/0
Functions
Applies the Scenario:init/0
callback
Applies the Scenario:start/1,2
callback
Applies the Scenario:terminate/0,1
callback
Types
-type state() :: term().
init/0
-type user_id() :: pos_integer().
Callbacks
-callback terminate() -> any().
Functions
-spec init(amoc:scenario()) -> {ok, state()} | {error, Reason :: term()}.
Applies the Scenario:init/0
callback
[amoc, scenario, init, _]
telemetry event.
-spec start(amoc:scenario(), user_id(), state()) -> any().
Applies the Scenario:start/1,2
callback
Either Scenario:start/1
or Scenario:start/2
must be exported from the behaviour module. if scenario module exports both functions, Scenario:start/2
is used.
[amoc, scenario, user, _]
telemetry event.
-spec terminate(amoc:scenario(), state()) -> ok | {ok, any()} | {error, Reason :: term()}.
Applies the Scenario:terminate/0,1
callback
Scenario:terminate/0
and Scenario:terminate/1
callbacks are optional. If the scenario module exports both functions, Scenario:terminate/1
is used.
[amoc, scenario, terminate, _]
telemetry event.