diff options
Diffstat (limited to 'lib/stdlib/src/gen_statem.erl')
-rw-r--r-- | lib/stdlib/src/gen_statem.erl | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/lib/stdlib/src/gen_statem.erl b/lib/stdlib/src/gen_statem.erl index 513118a874..49911eac2c 100644 --- a/lib/stdlib/src/gen_statem.erl +++ b/lib/stdlib/src/gen_statem.erl @@ -67,6 +67,14 @@ %% Type that is exported just to be documented -export_type([transition_option/0]). +%% Type exports for start_link & friends +-export_type( + [server_name/0, + server_ref/0, + start_opt/0, + start_ret/0, + enter_loop_opt/0]). + %%%========================================================================== %%% Interface functions. %%%========================================================================== @@ -424,28 +432,26 @@ timeout_event_type(Type) -> %%% API -type server_name() :: - {'global', GlobalName :: term()} + {'global', GlobalName :: term()} | {'via', RegMod :: module(), Name :: term()} | {'local', atom()}. -type server_ref() :: - pid() + pid() | (LocalName :: atom()) | {Name :: atom(), Node :: atom()} | {'global', GlobalName :: term()} | {'via', RegMod :: module(), ViaName :: term()}. --type debug_opt() :: - {'debug', - Dbgs :: - ['trace' | 'log' | 'statistics' | 'debug' - | {'logfile', string()}]}. --type hibernate_after_opt() :: - {'hibernate_after', HibernateAfterTimeout :: timeout()}. -type start_opt() :: - debug_opt() - | {'timeout', Time :: timeout()} - | hibernate_after_opt() - | {'spawn_opt', [proc_lib:spawn_option()]}. --type start_ret() :: {'ok', pid()} | 'ignore' | {'error', term()}. + {'timeout', Time :: timeout()} + | {'spawn_opt', [proc_lib:spawn_option()]} + | enter_loop_opt(). +-type start_ret() :: + {'ok', pid()} + | 'ignore' + | {'error', term()}. +-type enter_loop_opt() :: + {'hibernate_after', HibernateAfterTimeout :: timeout()} + | {'debug', Dbgs :: [sys:debug_option()]}. @@ -558,14 +564,14 @@ reply({To,Tag}, Reply) when is_pid(To) -> %% started by proc_lib into a state machine using %% the same arguments as you would have returned from init/1 -spec enter_loop( - Module :: module(), Opts :: [debug_opt() | hibernate_after_opt()], + Module :: module(), Opts :: [enter_loop_opt()], State :: state(), Data :: data()) -> no_return(). enter_loop(Module, Opts, State, Data) -> enter_loop(Module, Opts, State, Data, self()). %% -spec enter_loop( - Module :: module(), Opts :: [debug_opt() | hibernate_after_opt()], + Module :: module(), Opts :: [enter_loop_opt()], State :: state(), Data :: data(), Server_or_Actions :: server_name() | pid() | [action()]) -> @@ -579,7 +585,7 @@ enter_loop(Module, Opts, State, Data, Server_or_Actions) -> end. %% -spec enter_loop( - Module :: module(), Opts :: [debug_opt() | hibernate_after_opt()], + Module :: module(), Opts :: [enter_loop_opt()], State :: state(), Data :: data(), Server :: server_name() | pid(), Actions :: [action()] | action()) -> |