-
Notifications
You must be signed in to change notification settings - Fork 29
feat: poll many blocks #277
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
Conversation
| } | ||
| select { | ||
| case <-time.After(cp.cfg.PollInterval): | ||
| case <-ticker.C: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use a ticker for long-running loops, as time.After creates a new instance every iteration that needs to be garbage-collected
| } | ||
|
|
||
| func (cp *ChainPoller) setNextHeight(height uint64) { | ||
| cp.mu.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we run the unit tests with -race, we have a race condition, need a mutex for this
gitferry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Two comments:
gitferry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
closes #264