Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Actor Model in Ruby
Search
Celso Crivelaro
September 23, 2016
Technology
0
250
Actor Model in Ruby
Talk in RubyConf Brazil 2016
Celso Crivelaro
September 23, 2016
Tweet
Share
More Decks by Celso Crivelaro
See All by Celso Crivelaro
Sistemas de Recomendação
celsocrivelaro
2
210
Big Data para Gerentes de Projetos
celsocrivelaro
0
57
FileSystems em Ruby com FUSE
celsocrivelaro
2
64
Padrões e Boas Práticas de Teste de Tela
celsocrivelaro
0
410
Projeto de APIs
celsocrivelaro
0
160
Testing Network Conditions with ToxiProxy
celsocrivelaro
1
380
Testing Network Conditions with ToxiProxy
celsocrivelaro
0
80
Separando as regras de negócios do Rails
celsocrivelaro
0
180
InfluxDB + Grafana
celsocrivelaro
0
260
Other Decks in Technology
See All in Technology
おやつは300円まで!の最適化を模索してみた
techtekt
PRO
0
290
機械学習を扱うプラットフォーム開発と運用事例
lycorptech_jp
PRO
0
220
Snowflakeの生成AI機能を活用したデータ分析アプリの作成 〜Cortex AnalystとCortex Searchの活用とStreamlitアプリでの利用〜
nayuts
1
450
DevIO2025_継続的なサービス開発のための技術的意思決定のポイント / how-to-tech-decision-makaing-devio2025
nologyance
1
360
AIのグローバルトレンド2025 #scrummikawa / global ai trend
kyonmm
PRO
1
260
ZOZOマッチのアーキテクチャと技術構成
zozotech
PRO
3
1.4k
Grafana MCPサーバーによるAIエージェント経由でのGrafanaダッシュボード動的生成
hamadakoji
1
1.5k
品質視点から考える組織デザイン/Organizational Design from Quality
mii3king
0
160
20250903_1つのAWSアカウントに複数システムがある環境におけるアクセス制御をABACで実現.pdf
yhana
3
520
【Grafana Meetup Japan #6】Grafanaをリバプロ配下で動かすときにやること ~ Grafana Liveってなんだ ~
yoshitake945
0
410
[ JAWS-UG 東京 CommunityBuilders Night #2 ]SlackとAmazon Q Developerで 運用効率化を模索する
sh_fk2
2
310
これでもう迷わない!Jetpack Composeの書き方実践ガイド
zozotech
PRO
0
230
Featured
See All Featured
Music & Morning Musume
bryan
46
6.8k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.9k
Docker and Python
trallard
45
3.6k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Bash Introduction
62gerente
615
210k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
910
Practical Orchestrator
shlominoach
190
11k
Transcript
Actor Model in Ruby Celso Crivelaro @celsocrivelaro http://crivelaro.me 1
DEVELOPER @ PROFESSOR @
None
My problem
Authorization APIs SMTP Protocol Strange Protocol Strange Lib 5
Strange Protocol / Strange Lib => Unmaintained Bad documentation Troubleshooting
was impossible
Authorization APIs TCP/IP Custom Protocol SMTP Protocol
High Concurrency ~ 1000 connections Fault Tolerant Easy TCP Server
API
None
Actors Reactor 10
Actor Model Theory
Actor 1 Mailbox Actor 2 Mailbox Actor 3 Mailbox
Actors are similar to Objects
Send messages to each other Asynchronous Actors Objects Synchronous Create
new ones Isolated Share memory Keep state
Actors can be distributed 15
Actor 1 Mailbox Actor 2 Mailbox Actor 3 Mailbox
Fault Tolerant
Let it crash philosophy
Actor 1 Mailbox Actor 2 Mailbox Actor 3 Mailbox Actor
4 Mailbox A4 is linked to A2 A2 is warned when A4 crashes A2 takes an action (restart A4) Avoid defensive programming
Who implements Actors 20
Pykka
None
Celluloid Actors Ruby Objects Same structure from classes Runs over
threads / fibers Futures and Pools Sync / Async Methods
None
25
When Actor crashes…
None
What if another actor could do something?
Supervisors
30
None
Even if an Actor just terminates
None
Actor Supervisor Restart Actor Warn other Supervisor Callbacks Avoid begin…
rescue... / if Actions:
Must be finished to be CG’ed 35
None
Futures
None
Pool
Res 1 Res 2 Res 3 Pool Res 1 40
None
http://www.mikeperham.com/2015/10/14/should-you-use-celluloid/
None
Actors Reactor
Reactor Pattern 45
Handler 1 Handler 2 Dispatcher Handler 3 Handles service request
Delivered concurrently to handlers Demultiplexing Event Event Event
https://github.com/celluloid/nio4r
None
None
Server Celluloid:IO Supervisor 50
None
None
Important
Mutant Data Structure
Actor 1 Mailbox Actor 2 Mailbox Actor 3 Mailbox Microservices
55
Evaluate the best concurrency model Celluloid Documentation
References
http://www.brianstorti.com/the-actor-model/
None
https://www.sitepoint.com/an-introduction-to-celluloid-part-i/
https://github.com/celluloid/celluloid-io
http://queroserdevlocaweb.com.br/
Thank you! @celsocrivelaro Slides at http://crivelaro.me