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

errors and schedualling #38

Merged
merged 1 commit into from Apr 23, 2015

Conversation

calvinmetcalf
Copy link
Collaborator

slightly more complete solution to #37 with tests!

Errors are not rethrown so it will still show up as an uncaught error when used with a debuger also a try/catch is avoided which can be slow in certain browsers

@@ -14,5 +14,8 @@
"main": "./index.js",
"engines": {
"node": ">= 0.6.0"
},
"devDependencies": {
"tape": "^3.5.0"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use mocha for tests, and the dependency version must be specified explicitly

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@defunctzombie
Copy link
Owner

What does this do to the performance? One of the reasons all this changed was because there was some performance benefit originally iirc.

@calvinmetcalf
Copy link
Collaborator Author

good question let me put together something

@calvinmetcalf
Copy link
Collaborator Author

https://jsperf.com/asyncstuff/8, so modestly slower, though interestingly the try/catch is not the drain that I expected it would be

@calvinmetcalf
Copy link
Collaborator Author

but trying to do it with try in a way that doesn't move where the uncaught error ends up AND isn't super slow in firefox is proving challenging.

@defunctzombie
Copy link
Owner

Is this the final version of the PR or is it still being investigated?

@calvinmetcalf
Copy link
Collaborator Author

final, try/catch had some subtle and unexpected performance issues in certain browsers but was at best the same as this performance wise

@kahnvex
Copy link

kahnvex commented Apr 21, 2015

Subscribing, this will help me out, a lot.

if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code style: 4 spaces

@defunctzombie
Copy link
Owner

sorry for the delay. Just some minor comments. Please also squash the commits.

@calvinmetcalf
Copy link
Collaborator Author

fixed

@thomasw
Copy link

thomasw commented Apr 22, 2015

Thank you! I need this so badly!

defunctzombie added a commit that referenced this pull request Apr 23, 2015
@defunctzombie defunctzombie merged commit 295f3e1 into defunctzombie:master Apr 23, 2015
@vvo
Copy link

vvo commented Apr 23, 2015

NICE!

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.

None yet

5 participants