官方资料参考: Module:terminate(Reason, State) Types: Reason = normal | shutdown | {shutdown,term()} | term() State = term() This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessa…