anchor.diff:              Scenario:start(Id, State);
           false ->
               Scenario:start(Id)
  -    end,
  -    flush_mailbox().
  -
  --spec flush_mailbox() -> ok.
  -flush_mailbox() ->
  -    receive
  -        {'EXIT', _, _} ->
  -            stop();
  -        _ ->
  -            flush_mailbox()
  -    after 0 ->
  -        ok
  -    end.
  -
  -repeat(F) ->
  -    F(),
  -    timer:sleep(repeat_interval()),
  -    repeat(F).
  -
  -repeat(F, N) when N > 1 ->
  -    F(),
  -    timer:sleep(repeat_interval()),
  -    repeat(F, N - 1);
  -repeat(F, 1) ->
  -    F().
  -
  -repeat_interval() ->
  -    amoc_config_env:get(repeat_interval, ?REPEAT_INTERVAL).
  -
  -repeat_num() ->
  -    amoc_config_env:get(repeat_num, ?REPEAT_NUM).
  +    end.
positive.code:     proc_lib:init_ack(Parent, {ok, self()}),
      ets:insert(amoc_users, {Id, self()}),
      process_flag(trap_exit, true),
      F = fun() -> perform_scenario(Scenario, Id, State) end,
      R = try
              case repeat_num() of
                  infinity -> repeat(F);
                  N -> repeat(F, N)
              end,
              normal
          catch
              throw:normal_user_stop ->
  
negative.code: %% Licensed under the Apache License, Version 2.0 (see LICENSE file)
  %%==============================================================================
  -module(amoc_user).
  
  %% API
  -export([start_link/3]).
  