```
/* somewhere deep inside a module... */
var token = Tokens.create();
pair(email, token);
send(email, token);
```
```
/* in another module */
Tokens.create = function() {
crypto.randomBytes(48, function(ex, buf) {
var token = buf.toString('hex');
return token;
})
}
```
Will the `Tokens.create()` be ran in parallel to `pair(email, token)` and
`send(token, email)`? I'm trying to understand if i need to use a callback
or not here
Someone in IRC responded:
"just google for callbacks, in a nutshell when the second argument of
function is a function"
Tokens.create doesn't take a callback, but the function it calls,
`crypto.randomBytes`, does. So will `token = Tokens.create` be ran
asynchronously?
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/dfcad4b1-b068-4743-8915-1c70f1b54efa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.