class: center, middle # Celluloid, Actors in Ruby ### Nikica Jokić --- # What's an (Erlang) actor? -- * A high level concurrency abstraction -- - thread:actor != 1:1 -- * concurrent objects/processes, exist and are run independently -- - they [share nothing](https://en.wikipedia.org/wiki/Shared_nothing_architecture), everyting is communicated by messages -- - state is implicit (in method arguments and messages) -- * "Let it crash" -- - linking/monitoring -- - supervisors -- - supervision groups -- * [concurrency is not parallelism](http://blog.golang.org/concurrency-is-not-parallelism) --- # Cell = Ruby actor -- * objects that run concurrentlty -- - hold state in instance variables -- - variables are mutable in Ruby -- * internals -- - each object has its own thread -- - each message (method) runs inside a fiber (you can suspend/resume them) -- * error handling -- - linking and monitoring -- - no supervision trees for now --- ### Resources and Q&A If you want to know more: * [Celluloid wiki](https://github.com/celluloid/celluloid/wiki) * [Sitepoint blog series](http://www.sitepoint.com/an-introduction-to-celluloid-part-i/) * Soon: my blog post about Celluloid's internals