PRÉSENTATION




Mickael Couzinet    Jeudi 15 Mars 2012
HISTOIRE
CREATION

          Ryan DAHL




Début du projet : 16 février 2009
AUJOURD’HUI
KEZAKO ?
UN SERVEUR JAVASCRIPT

- RAPIDE

- ECRIT EN C/C++

- MOTEUR V8 DE GOOGLE POUR LE JS

- GROSSE COMMUNAUTE

- ENCORE TRES JEUNE
ARCHITECTURE


     LIBRAIRIES NODE


     INTERFACE NODE

         THREAD       EVENT
V8
          POOL        LOOP
GESTION DES THREADS

   WebApp               Node       Machine

Requete      Appel#1
  #1


Requete
  #2
            Reponse#1
             Appel#2




            Reponse#1
PROGRAMMATION NON BLOQUANTE
                       ---------BLOQUANT--------------------------------------------------
On lit deux fichiers
 Le premier étant      var fichier1 = readFyle(“fichier1.txt”);
 Plus lourd que le     Console.log(“Lecture fichier1”);
            second     var fichier2 = readFyle(“fichier2.txt”);
                       Console.log(“Lecture fichier2”);

                       -> Lecture fichier1 Lecture fichier2

                       ----------NON-BLOQUANT-----------------------------------------

                       var fichier1 = readFyle(“fichier1.txt”,function(err,data){
                       Console.log(“Lecture fichier1”);
                       });
                       var fichier2 = readFyle(“fichier2.txt”,function(err,data){
                       Console.log(“Lecture fichier2”);
                       });

                       -> Lecture fichier2 Lecture fichier1
LES MODULES
NODE PACKET MANAGER




- Plus de 6000 modules disponibles
- Installation des modules faciles
- Mise à jour en une ligne de commande
EXPRESS




- Framework ‘MVC ’
- Créé un environnement de dévellopement
- Facilite le développement d’application
  var express = require(‘express’);
  var app = express.createServer();

  app.get('/', function(req, res){
  res.send('Hello World');
  });

  app.listen(3000);
SOCKET.IO




- WebSocket
- Adobe® Flash® Socket
- AJAX long polling
- AJAX multipart streaming
DÉMONSTRATION
QUESTIONS ?
QUESTIONS ?

Présentation de Node.js

  • 1.
  • 2.
  • 3.
    CREATION Ryan DAHL Début du projet : 16 février 2009
  • 4.
  • 5.
  • 6.
    UN SERVEUR JAVASCRIPT -RAPIDE - ECRIT EN C/C++ - MOTEUR V8 DE GOOGLE POUR LE JS - GROSSE COMMUNAUTE - ENCORE TRES JEUNE
  • 7.
    ARCHITECTURE LIBRAIRIES NODE INTERFACE NODE THREAD EVENT V8 POOL LOOP
  • 8.
    GESTION DES THREADS WebApp Node Machine Requete Appel#1 #1 Requete #2 Reponse#1 Appel#2 Reponse#1
  • 9.
    PROGRAMMATION NON BLOQUANTE ---------BLOQUANT-------------------------------------------------- On lit deux fichiers Le premier étant var fichier1 = readFyle(“fichier1.txt”); Plus lourd que le Console.log(“Lecture fichier1”); second var fichier2 = readFyle(“fichier2.txt”); Console.log(“Lecture fichier2”); -> Lecture fichier1 Lecture fichier2 ----------NON-BLOQUANT----------------------------------------- var fichier1 = readFyle(“fichier1.txt”,function(err,data){ Console.log(“Lecture fichier1”); }); var fichier2 = readFyle(“fichier2.txt”,function(err,data){ Console.log(“Lecture fichier2”); }); -> Lecture fichier2 Lecture fichier1
  • 10.
  • 11.
    NODE PACKET MANAGER -Plus de 6000 modules disponibles - Installation des modules faciles - Mise à jour en une ligne de commande
  • 12.
    EXPRESS - Framework ‘MVC’ - Créé un environnement de dévellopement - Facilite le développement d’application var express = require(‘express’); var app = express.createServer(); app.get('/', function(req, res){ res.send('Hello World'); }); app.listen(3000);
  • 13.
    SOCKET.IO - WebSocket - Adobe®Flash® Socket - AJAX long polling - AJAX multipart streaming
  • 14.
  • 15.
  • 16.