diff options
author | José Valim <[email protected]> | 2017-06-22 19:54:26 +0200 |
---|---|---|
committer | José Valim <[email protected]> | 2017-08-05 18:58:52 +0200 |
commit | 69e009e3e1ad899a4609ff327a08512c86dba374 (patch) | |
tree | c4a431d3c7c7f8b8e02de0fe1ceb8028c61b56df /lib/runtime_tools/src/observer_backend.erl | |
parent | f52748254f17ba42e344798e8c787a1e3361fa33 (diff) | |
download | otp-69e009e3e1ad899a4609ff327a08512c86dba374.tar.gz otp-69e009e3e1ad899a4609ff327a08512c86dba374.tar.bz2 otp-69e009e3e1ad899a4609ff327a08512c86dba374.zip |
Add {continue, Term} and handle_continue/2 to gen_server
If the gen_server process needs to perform an action immediately
after initialization or to break the execution of a callback into
multiple steps, it can return {continue, term()} in place of the
time-out or hibernation value, which will immediately invoke the
handle_continue/2 callback with the given term.
This provides a more accessible approach to after initialization
compared to proc_lib+enter_loop that is also guaranteed to be
safe.
It also allows callbacks that need to do lengthy or stateful work
to checkpoint the state throughout multiple iterations. This can
be useful, for example, when implementing behaviours on top of
gen_server.
Diffstat (limited to 'lib/runtime_tools/src/observer_backend.erl')
0 files changed, 0 insertions, 0 deletions