Ruby programmers usually don’t need to think much about blocks… until they have to. As a contributor to Ruby gems that have callback-based API for developers, I’ve found that internal implementation details of these gems affects how these callbacks are executed and resulting behavior can be quite surprising sometimes, and I think that good Ruby developer should know inner workings of blocks to better understand execution flow of complex Ruby programs.
In this talk, I would like to increase public awareness of surprising behavior that can occur when a block is called from different threads, using instance_exec
, etc., with examples from open-source gems so everyone can improve their understanding of Ruby program execution details.