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

Fixed timer lifespan in 2013 advent cal async example #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nrdvana
Copy link

@nrdvana nrdvana commented Aug 21, 2015

This example appeared to work, but actually most requests were
having their timer cut short by the next request, because there
was only one global variable, and the program needed to hold
refs to multiple concurrent timers.

Solved in the simplest possible way by moving the timer ref
inside the timer callback to create a circular reference, though
aa better way would be to hold the timer ref in a global pool
and not form the circular ref in the first place. But, that's
more code...

This example appeared to work, but actually most requests were
having their timer cut short by the next request, because there
was only one global variable, and the program needed to hold
refs to multiple concurrent timers.

Solved in the simplest possible way by moving the timer ref
inside the timer callback to create a circular reference, though
aa better way would be to hold the timer ref in a global pool
and not form the circular ref in the first place.  But, that's
more code...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant