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

consumer: jitter might have no effect #113

Closed
wants to merge 0 commits into from
Closed

consumer: jitter might have no effect #113

wants to merge 0 commits into from

Conversation

judwhite
Copy link
Contributor

@judwhite judwhite commented Feb 9, 2015

please review if this is correct behavior

@mreiferson
Copy link
Member

Can you explain these changes? Not sure this is desirable...

@judwhite
Copy link
Contributor Author

judwhite commented Feb 9, 2015

ticker starts when it's created. when it's created before waiting on jitter the jitter has no effect, unless jitter is greater than the tick interval.

example:

start := time.Now()

ticker := time.NewTicker(1500 * time.Millisecond)
time.Sleep(1000 * time.Millisecond)

<-ticker.C

fmt.Println(time.Now().Sub(start))

@mreiferson
Copy link
Member

ahh, that makes more sense 👍, really nice catch!

@mreiferson
Copy link
Member

mind squashing down? thanks for this...

@mreiferson mreiferson changed the title lookupdLoop: move NewTicker to get jitter effect consumer: jitter might have no effect Feb 9, 2015
@mreiferson mreiferson added the bug label Feb 9, 2015
@judwhite judwhite closed this Feb 9, 2015
@judwhite
Copy link
Contributor Author

judwhite commented Feb 9, 2015

reopened as #114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants