This is what :proc_lib.start_link and :proc_lib.init_ack do under the hood too See here and here.
:proc_lib.start_link
:proc_lib.init_ack