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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Alexey Taktarov
May 07, 2012
Programming
6
540
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
Tweet
Share
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
130
React Hooks: Iteractivity in Functional Components (RU)
molefrog
0
100
Practical Serverless & Edge Computing
molefrog
2
280
Дизайн принципы для разработчиков. Может ли дизайн сделать наши программы лучше?
molefrog
0
170
Hooks in action: implementing a 1KB React router
molefrog
0
190
How to apply design principles in software engineering?
molefrog
0
300
Give a second change to Rails frontend!
molefrog
4
740
Heroes of Information Security
molefrog
4
190
Other Decks in Programming
See All in Programming
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
220
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
310
猫の手も借りたい!ので AIエージェント猫を作って社内に放した話 Claude Code × Container Lambda の Slack Bot "DevNeko"
naramomi7
0
220
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
540
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
490
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
11
5.5k
AIプロダクト時代のQAエンジニアに求められること
imtnd
1
500
CSC307 Lecture 10
javiergs
PRO
1
690
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
360
ふん…おもしれぇ Parser。RubyKaigi 行ってやるぜ
aki_pin0
0
120
AIに仕事を丸投げしたら、本当に楽になれるのか
dip_tech
PRO
0
170
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
3
350
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
Designing for Timeless Needs
cassininazir
0
150
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
200
WCS-LA-2024
lcolladotor
0
470
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
How to train your dragon (web standard)
notwaldorf
97
6.5k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Navigating Weather and Climate Data
rabernat
0
130
Amusing Abliteration
ianozsvald
0
120
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
260
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
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