Skip to content

Instantly share code, notes, and snippets.

@zhongwencool
Created October 2, 2019 01:50
Show Gist options
  • Save zhongwencool/2b8fa30f48ba1bef3cf6be96c9cc8c7a to your computer and use it in GitHub Desktop.
Save zhongwencool/2b8fa30f48ba1bef3cf6be96c9cc8c7a to your computer and use it in GitHub Desktop.
init([]) –>
{ok, #state{},next_report_time()}.
handle_info(timeout,State) –>
NewState = do_report_event(State),%% maybe spawn for heavy task
{noreply,NewState,next_report_time()}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment