Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Elixir - Exploring actor-based systems
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Michał Muskała
September 23, 2017
Programming
120
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Elixir - Exploring actor-based systems
Talk given at PartialConf 2017 in Sofia, Bulgaria
Michał Muskała
September 23, 2017
Transcript
73 slides
ELIXIR Exploring actor-based systems
ELIXIR Exploring actor-based systems The good parts
THE COMMUNITY
None
MICHAŁ MUSKAŁA http://michal.muskala.eu/ https://github.com/michalmuskala/ @michalmuskala
http://omt.tech/ Orther Mulelid-Tynes Technology, Inc.
THE MODERN COMPUTING
None
None
ACTOR MODEL
Actor Model Communicating Sequential Processes π-calculus Software Transactional Memory
None
FUNCTIONAL PROGRAMMING
• Explicit state • Transformation instead of mutation
– José Valim “Functional programming is associated with concurrency but
it was not by design. It just happens that, by making the complex parts of our system explicit, solving more complicated issues like concurrency becomes much simpler.”
None
None
Switch Switch
Server Server Browser Endpoints Mobile
None
2 MILLION CONNECTIONS on a single server https://blog.whatsapp.com/196/1-million- is-so-2011
None
None
http://www.phoenixframework.org/blog/the-road-to-2-million-websocket-connections
ELIXIR CONCURRENT FUNCTIONAL
Sequential code
Sequential code Functional code
None
x1 = async_func1() x2 = async_func2(x1) x3 = async_func3(x2) x4
= async_func4(x3) x5 = async_func5(x4) x6 = async_func6(x5)
async_func1() |> async_func2() |> async_func3() |> async_func4() |> async_func5() |>
async_func6()
None
None
OTP
DB Web Mailer Websockets
DB Web Mailer Websockets Supervisor
Application
None
None
app1@node1 app1@node2
– Joe Armstrong “We do not have ONE web-server handling
2 millions sessions. We have 2 million webservers handling one session each.”
GOALS OF ELIXIR
THE GOALS OF ELIXIR • COMPATIBILITY • EXTENSIBILITY • PRODUCTIVITY
None
THE GOALS OF ELIXIR • COMPATIBILITY • EXTENSIBILITY • PRODUCTIVITY
THE GOALS OF ELIXIR • COMPATIBILITY • EXTENSIBILITY • PRODUCTIVITY
• PRODUCTIVITY • MAINTAINABILITY • RELIABILITY
COMPATIBILITY
https://elixir-lang.org/crash-course.html
EXTENSIBILITY
defmodule Test do use ExUnit.Case, async: true test "math works"
do assert 1 + 2 == 2 end end
None
from w in Weather, where: w.prcp <= 0.0 or is_nil(w.prcp),
order_by: w.city, select: w
defmacro if(condition, clauses) do optimize_boolean(quote do case unquote(condition) do x
when x in [false, nil] -> unquote(else_clause) _ -> unquote(do_clause) end end) end
PRODUCTIVITY
None
None
None
None
HEXDOCS • https://hexdocs.pm/elixir/String.html • https://hexdocs.pm/elixir/1.5.0/String.html • https://hexdocs.pm/phoenix/Phoenix.Channel.html • https://hexdocs.pm/phoenix/1.2.0/Phoenix.Channel.html
None
None
None
None
None
DEMO
MAINTAINABILITY
RELIABILITY
HOW DO I START?
elixir-lang.org
None
None
• http://elixir-lang.org • http://www.erlang.org • http://nerves-project.com • http://www.phoenixframework.org/
ELIXIR Exploring actor-based systems
None
More Decks by Michał Muskała
See All by Michał Muskała
From Elixir to Erlang - Experience report
michalmuskala
0
92
What is the BEAM?
michalmuskala
0
150
Elixir & Ecosystem Update SF 2020
michalmuskala
0
61
Let there be light
michalmuskala
0
810
What actually is the BEAM?
michalmuskala
6
1.8k
Optimising for the BEAM
michalmuskala
2
790
Extending OTP with custom behaviours
michalmuskala
0
210
Abandoning models - embracing data
michalmuskala
0
310
Ecto - the past, the present, the future
michalmuskala
5
1.2k
Other Decks in Programming
See All in Programming
Distance field of Julia set
kinakomoti321
0
320
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
860
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
230
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
330
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
300
AI Augmentation Techniques with Liberty
ivargrimstad
1
470
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
120
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
200
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
340
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9.1k
地方こそサーバーレス — 10年続けた、顔が見えるチームで確かな基盤を / Serverless Matters Most in Regional Areas — 10 Years of Building Reliable Foundations with Close-Knit Teams
seike460
PRO
1
430
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
340
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.5k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
470
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
sira's awesome portfolio website redesign presentation
elsirapls
0
510
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
GraphQLとの向き合い方2022年版
quramy
50
15k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.7k
Mobile First: as difficult as doing things right
swwweet
225
10k