-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fix 135 #151
Fix 135 #151
Conversation
@@ -30,6 +30,16 @@ export default function Backburner(queueNames, options) { | |||
end: [], | |||
begin: [] | |||
}; | |||
|
|||
var backburner = this; | |||
this.executeTimers = function () { |
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.
Why not just put this on the prototype
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.
Because the point is to bind to this so we don't remake the bound function every time.
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.
are you ok with moving the content of this function to on the prototype?
prototype.executeTimers = function () {
.. content of your function.
}
We can then in the constructor do what you just did.
var backburner = this;
this.boundExecuteTimers = function() {
return backburner.executeTimers.bind(backburner);
}
Why?
- the function logic is where one would expect it to be.
@rwjblue @stefanpenner when tests are green this is merge-able pending review. |
tests appear unhappy |
Cleanup timers to make clear what is going on. Simplify based on the fact we are inserting into the _timers in sorted order. Remove multiple sources of truth. Simplify stale timer handling (should we move this check in other spots like run)? Remove duplicate test of hanging issue, the other one with the spin is more reliable.
LGTM @stefanpenner - r? |
LGTM |
following up with another quick cleanup PR |
follow up pr #152 |
some of the tests intermittently fail.
Closes #146
Closes #137
Closes #143
Fixes #135