Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Got Milk? A short introduction to node.js and e...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Alexey Taktarov
May 07, 2012
Programming
570
6
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Got Milk? A short introduction to node.js and event-driven programming.
A short introduction to node.js and event-driven programming.
Alexey Taktarov
May 07, 2012
More Decks by Alexey Taktarov
See All by Alexey Taktarov
The challenges of web apps: what we’ve solved and what’s next?
molefrog
0
180
React Hooks: Iteractivity in Functional Components (RU)
molefrog
0
130
Practical Serverless & Edge Computing
molefrog
2
300
Дизайн принципы для разработчиков. Может ли дизайн сделать наши программы лучше?
molefrog
0
190
Hooks in action: implementing a 1KB React router
molefrog
0
220
How to apply design principles in software engineering?
molefrog
0
340
Give a second change to Rails frontend!
molefrog
4
780
Heroes of Information Security
molefrog
4
220
Other Decks in Programming
See All in Programming
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
230
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
260
フィードバックで育てるAI開発
kotaminato
1
110
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.4k
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.4k
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
350
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
480
スマートグラスで並列バイブコーディング
hyshu
0
290
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
150
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
130
Webフレームワークの ベンチマークについて
yusukebe
0
200
1B+ /day規模のログを管理する技術
broadleaf
0
130
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
800
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.5k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
360
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
A Tale of Four Properties
chriscoyier
163
24k
Designing for Performance
lara
611
70k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
330
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Paper Plane (Part 1)
katiecoart
PRO
0
9.6k
Code Reviewing Like a Champion
maltzj
528
40k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Transcript
Got milk?
None
milk = dear_son.please_buy_a_milk();
milk = dear_son.please_buy_a_milk();
milk = dear_son.please_buy_a_milk(); dear_son.thank_you(); milk.drink();
milk = dear_son.please_buy_a_milk(); dear_son.thank_you(); milk.drink(); Blocking operations
milk = dear_son.please_buy_a_milk();
milk = dear_son.please_buy_a_milk(); do_cleanup(); do_something_else();
milk = dear_son.please_buy_a_milk(); do_cleanup(); do_something_else(); /* ? dear_son.here_is_your_milk(); */ Non-Blocking
operations
Event-Loop
milk = dear_son.please_buy_a_milk(); /* Event loop starts - while(…) */
if( dear_son.milk_ready() ) break; do_some_cleanup(); /* Event loop ends */ Event-Loop
In terms of: 1. OS ( process, threads scheduling) 2.
Application ( event-loops, overlapped system calls, callbacks )
OS can handle it. So why should I know about
event-loops and other sh!t?!
That’s why
Introducing Node.Js! Event-driven I/O server-side JavaScript framework based on V8
Why Javascript? 1. It’s awesome 2. It’s simple 3. It’s
popular 4. V8 is really fast 5. Built-in support for callbacks, lambdas, closures and other magic
setTimeout(function() { console.log('Hello, '); }, 1000); console.log(' World!'); Dummy example
#1
Dummy example #2 var http = require(‘http’); http.createServer(function (req, res)
{ res.writeHead(200, {'Content-Type': ‘text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at port 1337');
Web-Server | CGI | php, perl, python, etc.
Node.Js (all-in-one: web-server, caching, parsing, templating, data-storing, doing-a-sandwich)
Features 1. Clustering 2. Packages: web-frameworks, DB, graphics, BNF parsers,
unit- testing, … + package manager 3. Cloud 9 IDE (runs in browser)
Problems Asynchronous logic hell!
Problems Asynchronous logic hell! 1. Using helper modules (deferred, async,
node-fibers) 2. Program is Finite State Machine
The main problem Node.Js is very young, so be careful!
Use it just-for-fun!
Resources 1. “UNIX internals” by U.Vahalia 2. “Thinking Asynchronous in
C++” by author of boost::asio http://blog.think-async.com/ 3. Online npm repository http://search.npm.js 4. Cloud 9 IDE http://c9.io
Have a nice milk! Speaker: Taktarov A. Drawings: Taktarov E.
molefrog[at]gmail.com