Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[all] Use 'timer:send_after/3' for the periodic action in gen_server #653

Closed
mocchira opened this issue Mar 24, 2017 · 2 comments
Closed

Comments

@mocchira
Copy link
Member

mocchira commented Mar 24, 2017

not only

but anywhere now using an alternative method like built-in timeout feature in gen_server or other functions in timer module that can cause timer to be accumulated under heavy load so maybe result in get system overloaded and cause timeout for gen_server:call such as #652.

Reference: http://stackoverflow.com/questions/5883741/how-to-perform-actions-periodically-with-erlangs-gen-server

@mocchira
Copy link
Member Author

Since the code (leo_mq and leo_watchdog) using alternative methods very frequently has been replaced with the timer:send_after and the other code also using alternative ones are less (>= timers:seconds(1)) called compared to leo_mq and leo_watchdog, there seems to be almost no code to be replaced.

Please drop the comment if you find any code to be replaced with timer:send_after at any other place.
I will close this issue if no one find such code.

Note:
leo_logger seems to have such code however now we are discussing on #729 to replace it with lager so it should not be deal breaker to close this issue.

@mocchira
Copy link
Member Author

Close as no one find any problem.

@yosukehara yosukehara changed the title [all] Use timer:send_after for the periodic action in gen_server [all] Use 'timer:send_after/3' for the periodic action in gen_server Aug 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants