sanwaad presentation

17
Node.js

Upload: swapnil-mahajan

Post on 01-Sep-2014

442 views

Category:

Technology


0 download

Tags:

DESCRIPTION

 

TRANSCRIPT

Page 1: Sanwaad presentation

Node.js

Page 2: Sanwaad presentation

Set of libraries on top of V8

Page 3: Sanwaad presentation

Evented I/O

e.g. ioOperation(args, callbackFunction);

Page 4: Sanwaad presentation

Evented

setTimeout(function(){console.log(“world”);},2000);console.log(“hello”);

Sequential

print(“hello”);sleep(2);print (“world”);

Page 5: Sanwaad presentation

No threads :)

More scalable

Code in js

Benefits

Page 6: Sanwaad presentation

WebSocket

Page 7: Sanwaad presentation

Full duplex single socket connection

Page 8: Sanwaad presentation

Polling

Client Server

Something new ?

NO !!!

Something new ?

NO !!!

Something new ?

Yeah! Here it is !

Page 9: Sanwaad presentation

Long-Polling = polling with time factor

Page 10: Sanwaad presentation

Benefits

Bi-directional communication

Full duplex

Less overhead as compared to HTTP/AJAX

Page 11: Sanwaad presentation

Sanwaad

Page 12: Sanwaad presentation

The real-time chat server

Page 13: Sanwaad presentation

Design

Server:

app.js – routersanwaad.js – controllerindex.jade – view

Page 14: Sanwaad presentation

Design...

Client:

landing HTML pagelib.css – cascaded stylesheetlib.js – client side java scriptjquery.js – a js library to write less and do more

Page 15: Sanwaad presentation

Design...

Testing:

qunit.js – javascript test suiteutest.js – unit teststestRunner.html – Test Runner

Page 16: Sanwaad presentation

Demo

Page 17: Sanwaad presentation

Questions ?