Whenever a new event handler is added to an event manager,
@@ -470,8 +472,9 @@ gen_event:stop -----> Module:terminate/2
the argument provided in the function call/return tuple and
Term is the result of terminating the old event handler,
see gen_event:swap_handler/3.
- The function should return {ok,State} or {ok,State, hibernate}
- where State is the initial internal state of the event handler.
+ If successful, the function should return {ok,State}
+ or {ok,State,hibernate} where State is the
+ initial internal state of the event handler.
If {ok,State,hibernate} is returned, the event
manager will go into hibernation (by calling proc_lib:hibernate/3),
diff --git a/lib/stdlib/src/gen_event.erl b/lib/stdlib/src/gen_event.erl
index 9879b76391..3317b30e5c 100644
--- a/lib/stdlib/src/gen_event.erl
+++ b/lib/stdlib/src/gen_event.erl
@@ -70,7 +70,8 @@
-callback init(InitArgs :: term()) ->
{ok, State :: term()} |
- {ok, State :: term(), hibernate}.
+ {ok, State :: term(), hibernate} |
+ {error, Reason :: term()}.
-callback handle_event(Event :: term(), State :: term()) ->
{ok, NewState :: term()} |
{ok, NewState :: term(), hibernate} |
--
cgit v1.2.3