Skip to content

Request , Email , Child process , Passenger , NPM , Long Polling

Rnjai Lamba edited this page Mar 17, 2016 · 3 revisions

Request

post request nodejs- http://stackoverflow.com/questions/27190447/pass-json-to-http-post-request
variable done js - http://stackoverflow.com/questions/6240324/get-a-variable-after-ajax-done http://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call

NPM

publish to npm - https://quickleft.com/blog/creating-and-publishing-a-node-js-module/
node js test - http://stackoverflow.com/questions/9722407/how-do-you-install-and-run-mocha-the-node-js-testing-module-getting-mocha-co http://mherman.org/blog/2015/09/10/testing-node-js-with-mocha-and-chai/#test—get-all

Polling

long polling - http://www.stoimen.com/blog/2010/12/02/diving-into-node-js-a-long-polling-example/
http://stackoverflow.com/questions/1086380/how-does-facebook-gmail-send-the-real-time-notification
long poll vs web socket(super) -http://stackoverflow.com/questions/10028770/html5-websocket-vs-long-polling-vs-ajax-vs-webrtc-vs-server-sent-events
long polling still ok - http://blog.fanout.io/2013/03/04/long-polling-doesnt-totally-suck/
long polling fails on lost connections - http://moduscreate.com/fast-polling-vs-websockets-2/
socket io demo with nodes - https://nodesource.com/blog/understanding-socketio/
socket io good example with mysql - https://codeforgeek.com/2015/03/real-time-app-socket-io/

Passenger

Passenger - https://www.phusionpassenger.com/library/walkthroughs/basics/nodejs/fundamental_concepts.html
https://www.phusionpassenger.com/library/indepth/nodejs/

Child Process

Child process - https://medium.com/@graeme_boy/how-to-optimize-cpu-intensive-work-in-node-js-cdc09099ed41#.3uxpbhnta
spawn vs exec - http://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html
http://krasimirtsonev.com/blog/article/Nodejs-managing-child-processes-starting-stopping-exec-spawn
example - https://gist.github.com/brugnara/827f64c216c5325aea4d

It is possible to create a parent nodejs process from which we can fork other child processes( website, blog)
http://stackoverflow.com/questions/17861362/node-js-child-process-difference-between-spawn-fork
A new instance of the v8 engine is created and the child process runs independant of the parent process.
http://www.codingdefined.com/2014/08/difference-between-fork-spawn-and-exec.html
video - https://www.youtube.com/watch?v=9o8B3L0-d9c

Nodejs runs in single process.
Exec is for running terminal commands - Buffer - no new v8
Spawn is for running terminal commands - Stream - no new v8
Fork is for created workers/ node modules - v8

Email
https://mjml.io/