~/talk

Constantly Losing Stuff: continuation local storage in Node

Talkat CascadiaJS 2014 · 2014-07-31..08-01· [nodejs, concurrency]
slides:none on file

Continuation Local Storage implements per-request globals for Node by creating process-wide namespaces and running code inside them, backed by an async-listener API that monkey-patches core async ops. The module is roughly 150 lines of JS while the listener is ~450 lines, handles transactions in production (used by New Relic in production), but needs explicit namespace.bind or emitter binding for connection pools, streams and many promise libraries; CPU cost spikes in tight loops (tests showed ~800x) but is negligible with I/O.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:52Thread local vs continuation passing
  3. 3:38Problems with request state handling
  4. 6:25Introducing continuation local storage
  5. 8:56How continuation local storage works
  6. 12:04CLS API and usage basics
  7. 13:07Practical use cases for CLS
  8. 14:50Handling edge cases with CLS
  9. 17:16Performance and trade-offs
  10. 18:45Who uses continuation local storage
  11. 19:47Alternatives in browser and Node
  12. 22:33Future of CLS and next steps
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.