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

Fix 135 #151

Merged
merged 2 commits into from
Sep 11, 2015
Merged

Fix 135 #151

merged 2 commits into from
Sep 11, 2015

Conversation

krisselden
Copy link
Collaborator

some of the tests intermittently fail.

Closes #146
Closes #137
Closes #143
Fixes #135

@@ -30,6 +30,16 @@ export default function Backburner(queueNames, options) {
end: [],
begin: []
};

var backburner = this;
this.executeTimers = function () {
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

@krisselden
Copy link
Collaborator Author

@rwjblue @stefanpenner when tests are green this is merge-able pending review.

@stefanpenner
Copy link
Collaborator

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.
@rwjblue
Copy link
Collaborator

rwjblue commented Sep 11, 2015

LGTM

@stefanpenner - r?

@stefanpenner
Copy link
Collaborator

LGTM

stefanpenner added a commit that referenced this pull request Sep 11, 2015
@stefanpenner stefanpenner merged commit 91f8059 into master Sep 11, 2015
@stefanpenner
Copy link
Collaborator

following up with another quick cleanup PR

@stefanpenner stefanpenner deleted the fix-135 branch September 11, 2015 19:08
@stefanpenner
Copy link
Collaborator

follow up pr #152

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.

4 participants