Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

crypto: use domains for any callback-taking method #8380

Closed
wants to merge 6 commits into from

Conversation

chrisdickinson
Copy link

This adds domains coverage for pdbkdf2, pseudoRandomBytes, and randomBytes.
All others should be covered by event emitters.

Fixes #5801.

This adds domains coverage for pdbkdf2, pseudoRandomBytes, and randomBytes.
All others should be covered by event emitters.

Fixes nodejs#5801.
@indutny
Copy link
Member

indutny commented Sep 16, 2014

LGTM, is it everything that you wanted to get in?

@tjfontaine
Copy link

I was taking a slightly different route, can you do something like this?

https://gist.github.com/tjfontaine/2eb6373d6e593ae13a52

making an inline convenience function for GetActiveDomain?

@indutny
Copy link
Member

indutny commented Sep 16, 2014

@tjfontaine this looks nice.

var crypto = require('crypto');
var domain = require('domain');
var d = domain.create();
d.on('error', function (e) { console.log('got', e.message); });

Choose a reason for hiding this comment

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

perhaps validate the number of times the error handler runs? and potentially has the errors we care about?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed!

@tjfontaine
Copy link

thanks, landed in 6e689ec

@tjfontaine tjfontaine closed this Sep 16, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants