-
Notifications
You must be signed in to change notification settings - Fork 5
Adds memoryless package #24
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
Mmeoryless allows the running of functions as Poisson processes.
Pull Request Test Coverage Report for Build 255
💛 - Coveralls |
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.
one request to verify behavior of timer GC. Please don't submit without positively verifying.
Reviewed 3 of 4 files at r1.
Reviewable status:complete! 1 of 1 LGTMs obtained
memoryless/memoryless.go, line 19 at r1 (raw file):
Min <= Expected <= Max (or Min <= Expected and Max is 0)
Please arrange fields individually with some help text describing the condition above.
memoryless/memoryless.go, line 76 at r1 (raw file):
// finished by the time the function is done" condition will not have the // potential to cause livelock for Run() done := false
I don't have a better answer, but want to ask: is this as simple as it can be?
memoryless/memoryless.go, line 84 at r1 (raw file):
// Start the timer before the function call because the time between function // call *starts* should be exponentially distributed. t := time.NewTimer(c.waittime())
My understanding is that timers are managed by the Go runtime. And, the time.Tick
docs warn of leaks when the "timer is not shutdown properly". Please verify that overwriting the variable is sufficient to release the resources of a new timer without calling .Stop
.
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.
Reviewable status:
complete! 1 of 1 LGTMs obtained
memoryless/memoryless.go, line 19 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
Min <= Expected <= Max (or Min <= Expected and Max is 0)
Please arrange fields individually with some help text describing the condition above.
Done.
memoryless/memoryless.go, line 76 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
I don't have a better answer, but want to ask: is this as simple as it can be?
No! Fixed!
memoryless/memoryless.go, line 84 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
My understanding is that timers are managed by the Go runtime. And, the
time.Tick
docs warn of leaks when the "timer is not shutdown properly". Please verify that overwriting the variable is sufficient to release the resources of a new timer without calling.Stop
.
Tickers are Timers which never stop repeating. Leaking them is bad. Timers fire at most once and then exit. Leaking them is more okay. Added code to stop it anyway.
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.
Reviewable status:
complete! 1 of 1 LGTMs obtained
memoryless/memoryless.go, line 23 at r2 (raw file):
Min time.Duration // Max provides clamping of the randomly produced value. All timers will take // at least Max time.
typo: "at most".
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.
Reviewed 1 of 1 files at r2.
Reviewable status:complete! 1 of 1 LGTMs obtained
Mmeoryless allows the running of functions as Poisson processes.
This change is