~/talk

Threads, callbacks, and execution context in Ruby

Talkat RubyConf AU 2024 · 2024-04-11..04-12· [ruby]
links:none on file
slides:none on file

Blocks behave like closures with captured self and local bindings that can change later, and they can run in different execution contexts and threads so the exact guarantee matters: a nuts client moves from one thread per subscription to a thread pool, benchmarks show several‑times faster for tens of thousands of subscriptions and a crash around 32,000 subscriptions prompted the change, which can silently break code that relies on Thread.current or on a stable call context.

AI-written summary · about

  1. 0:00Introduction
  2. 5:08Ruby callbacks and worldview
  3. 7:13Ruby blocks as closures
  4. 9:23Changing execution context in blocks
  5. 11:13Blocks and thread-local data
  6. 13:00Case study: NATS Ruby client
  7. 15:54Thread pool behavior implications
  8. 16:36Thread context best practices
  9. 17:17Closing remarks
~/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.