Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Workshop node.js

Workshop node.js

Workshop apresentado em 21/08 em Porto Alegre.

Códigos mostrados durante o workshop https://gist.github.com/ricardobeat/6314596.

Conteúdo e mais informações em http://workshop-node.desorientados.com.br.

Jean Carlo Emer

August 21, 2013
Tweet

More Decks by Jean Carlo Emer

Other Decks in Programming

Transcript

  1. Workshop Node.js
    com @ricardobeat e @jcemer

    View full-size slide

  2. JavaScript no servidor

    View full-size slide

  3. Por que Node.js?

    View full-size slide

  4. 1. Detecção de
    eventos
    2. Tratamento dos
    mesmos
    (tick)

    View full-size slide

  5. Concorrência
    &
    Escalabilidade

    View full-size slide

  6. 1m conexões
    1 servidor
    16GB RAM
    40.000 mensagens/s
    ~70ms
    http://blog.caustik.com/2012/08/19/node-js-w1m-concurrent-connections

    View full-size slide

  7. node_modules

    View full-size slide

  8. Organizando código
    usando módulos

    View full-size slide

  9. Small core
    many (small) modules

    View full-size slide

  10. http://hughsk.github.io/disc/

    View full-size slide

  11. Event Emitter

    View full-size slide

  12. Event Emitter é usado em todo o core
    do node.js

    View full-size slide

  13. API e módulos nativos

    View full-size slide

  14. Interface usada para interagir com
    fluxos de dados assíncronos
    Baseada em event emitters

    View full-size slide

  15. Readable
    Writable
    Transform
    .pipe()

    View full-size slide

  16. Utilizada para ler/escrever dados de
    um arquivo (ou HTTP)

    View full-size slide

  17. https://github.com/substack/stream-handbook

    View full-size slide

  18. Controle de fluxo
    https://github.com/caolan/async

    View full-size slide

  19. https://github.com/visionmedia/co

    View full-size slide

  20. Coffee break

    View full-size slide

  21. Construíndo uma
    aplicação

    View full-size slide

  22. Fonte: Kurose

    View full-size slide

  23. google.com
    GET

    View full-size slide

  24. Express.js
    http://expressjs.com/applications.html

    View full-size slide

  25. Fonte: Kurose

    View full-size slide

  26. Eventos em tempo real

    View full-size slide

  27. npm install mongoose

    View full-size slide

  28. npm install redis

    View full-size slide

  29. npm install level

    View full-size slide

  30. Standalone test spies, stubs and
    mocks for JavaScript.

    View full-size slide

  31. Guest talk
    Rodrigo Krummenauer do
    Nascimento
    Desenvolvedor e empresário focado nas
    startups carddi.mobi e konecty.com

    View full-size slide

  32. Build & Deploy

    View full-size slide

  33. CoffeeScript

    View full-size slide

  34. Linguagem que compila
    para Javascript

    View full-size slide