On Jan 12, 2015, at 11:29 AM, Zeev Atlas wrote: > > The sample code I've seen is starting child process and giving it a reference > to a callback function, so I perceived it as something like a 'fork' plus > 'and once you finish, please call back' which is an ingenious idea but > conceptually it is a fork, hence my question. > Is there any other use for callback mechanism?
Callbacks are used constantly in node. You probably won't write much code in node that doesn't use a callback in some way. You tell node to do something, and give it a callback function to call when it's done doing it. Spawning a child process is done only in special situations. For example, maybe you have a command line program you want to run to get its output. So you tell node to spawn the child process and call a callback with the output when it's done running it. -- 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/7E2415B9-0811-4306-9386-9403D16FAC6D%40ryandesign.com. For more options, visit https://groups.google.com/d/optout.
