Use erlang:send_after instead of timer:send_interval in controller_comet. #538

Closed
mmzeeman opened this Issue Mar 15, 2013 · 1 comment

Comments

Projects
None yet
1 participant
@mmzeeman
Owner

mmzeeman commented Mar 15, 2013

Usage of timer:send_interval can lead a very large number of timers being created in controller_comet.

When this hapens the timer server will become a bottleneck. Use erlang:send_after is much cheaper for dynamically generated timers.

@mmzeeman

This comment has been minimized.

Show comment Hide comment
@mmzeeman

mmzeeman Mar 15, 2013

Owner

During changing the code I also spotted a subtle bug which can lead to missed updates when multiple scripts are pushed to the page within 50 ms. Resetting the timer will cause the comet process to crash.

Owner

mmzeeman commented Mar 15, 2013

During changing the code I also spotted a subtle bug which can lead to missed updates when multiple scripts are pushed to the page within 50 ms. Resetting the timer will cause the comet process to crash.

@mmzeeman mmzeeman closed this in 26c15b5 Mar 15, 2013

rpip pushed a commit to rpip/zotonic that referenced this issue Aug 12, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment