+ All Categories
Home > Technology > How to achive dynamic scoping in Node.js

How to achive dynamic scoping in Node.js

Date post: 14-Jul-2015
Category:
Upload: dmytrii-shchadei
View: 601 times
Download: 2 times
Share this document with a friend
Popular Tags:
23
N J S O D E . revolution with a dynamic scopE Dmytrii Shchadei @ Metrofun
Transcript

N

JS

O DE

.

revolutionwith a dynamic scopE

Dmytrii Shchadei @Metrofun

Story BeginsBACK in …

“In theory there is no difference between theory and practice.

In practice there is”.

NODE.JS RE:LOADED

“this” is a keyword, not a variableJavascript has a lexical scoping

Javascript SCOPEgotchas

DYNAMIC SCOPE

DYNAMIC SCOPE

DYNAMIC SCOPE

DYNAMIC SCOPE

DYNAMIC SCOPEIntentionally simplE

embedding is not implemented!!

do it yourself and have fun :)

DYNAMIC SCOPE

HOMEWORKhttp://nodejs.org/api/domain.htmlhttp://www.slideshare.net/domenicdenicola/domains-20010482

PROFIT *

Better isomorphic frameworks

Loose coupling

Per-request caching

CAVEATS

** Domains have performance hit ( only ~5% rps reduce )

* Some libraries doesn’t support domains ( use domain.bind )

THANK you!

Dmytrii Shchadei @Metrofun


Recommended