-
Notifications
You must be signed in to change notification settings - Fork 30k
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
doc: non-partitioned async crypto operations #17250
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Neither crypto.randomBytes nor crypto.randomFill partitions the work submitted to the threadpool. This change was suggested during the discussion of nodejs#17054. See also nodejs#17154.
nodejs-github-bot
added
crypto
Issues and PRs related to the crypto subsystem.
doc
Issues and PRs related to the documentations.
labels
Nov 22, 2017
jasnell
approved these changes
Nov 22, 2017
Example for var nBytes = 10 * 1024*1024; /* 10 MB */
var nLongRequests = 20;
const crypto = require('crypto');
for (var i = 0; i < nLongRequests; i++) {
crypto.randomBytes(nBytes, (buf) => {
console.log('Long buf finished');
});
}
crypto.randomBytes(1, (buf) => {
console.log('Short buf finished');
});
console.log('begin'); Example for var nBytes = 10 * 1024*1024; /* 10 MB */
var nLongRequests = 20;
const crypto = require('crypto');
for (var i = 0; i < nLongRequests; i++) {
var buf = Buffer.alloc(nBytes);
crypto.randomFill(buf, () => {
console.log('Long buf finished');
});
}
var shortBuf = Buffer.alloc(1);
crypto.randomFill(shortBuf, () => {
console.log('Short buf finished');
});
console.log('begin'); Both of these examples only handle the short request after the threadpool queue empties of the long ones, so "Short buf finished" prints before the final 3 "Long buf finished" messages with |
benjamingr
approved these changes
Nov 25, 2017
cjihrig
approved these changes
Nov 25, 2017
evanlucas
approved these changes
Nov 25, 2017
addaleax
approved these changes
Nov 27, 2017
addaleax
approved these changes
Nov 27, 2017
addaleax
added
the
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
label
Nov 27, 2017
Landed in 16e87ed |
addaleax
removed
the
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
label
Nov 28, 2017
addaleax
pushed a commit
that referenced
this pull request
Nov 28, 2017
Neither crypto.randomBytes nor crypto.randomFill partitions the work submitted to the threadpool. This change was suggested during the discussion of #17054. See also #17154. PR-URL: #17250 Refs: #17154 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins
pushed a commit
that referenced
this pull request
Dec 12, 2017
Neither crypto.randomBytes nor crypto.randomFill partitions the work submitted to the threadpool. This change was suggested during the discussion of #17054. See also #17154. PR-URL: #17250 Refs: #17154 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins
pushed a commit
that referenced
this pull request
Dec 12, 2017
Neither crypto.randomBytes nor crypto.randomFill partitions the work submitted to the threadpool. This change was suggested during the discussion of #17054. See also #17154. PR-URL: #17250 Refs: #17154 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins
pushed a commit
that referenced
this pull request
Dec 12, 2017
Neither crypto.randomBytes nor crypto.randomFill partitions the work submitted to the threadpool. This change was suggested during the discussion of #17054. See also #17154. PR-URL: #17250 Refs: #17154 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Merged
gibfahn
pushed a commit
that referenced
this pull request
Dec 19, 2017
Neither crypto.randomBytes nor crypto.randomFill partitions the work submitted to the threadpool. This change was suggested during the discussion of #17054. See also #17154. PR-URL: #17250 Refs: #17154 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
If anyone would like to backport to 6.x please feel free (guide)! |
Closed
gibfahn
pushed a commit
that referenced
this pull request
Dec 20, 2017
Neither crypto.randomBytes nor crypto.randomFill partitions the work submitted to the threadpool. This change was suggested during the discussion of #17054. See also #17154. PR-URL: #17250 Refs: #17154 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Neither crypto.randomBytes nor crypto.randomFill
partitions the work submitted to the threadpool.
This change was suggested during the discussion of #17054.
See also #17154.
Checklist
Affected core subsystem(s)
doc, crypto