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
Elixir - valentine edition
Search
Saša Jurić
February 14, 2017
Programming
0
120
Elixir - valentine edition
Saša Jurić
February 14, 2017
Tweet
Share
More Decks by Saša Jurić
See All by Saša Jurić
Such Great Heights, Code BEAM Lite, Amsterdam 2018
sasajuric
0
150
Simplifying systems with Elixir - Belgrade
sasajuric
3
410
Simplifying systems with Elixir
sasajuric
2
550
Metagrokking Elixir
sasajuric
4
280
Solid Ground
sasajuric
15
1.2k
Solid Ground
sasajuric
3
830
What's the fuss about Phoenix?
sasajuric
2
1k
Phoenix
sasajuric
1
210
Phoenix
sasajuric
0
110
Other Decks in Programming
See All in Programming
NEWTにおけるiOS18対応の進め方
ryu1sazae
0
210
上手に付き合うコンポーネントテスト
quramy
3
1.2k
[PHPカンファレンス沖縄2024]「無理なくできるだけ安全に」テストもないレガシーコードをリファクタリングするテクニック
ikezoemakoto
3
120
pytest プラグインを開発して DRY に自動テストを書こう
inuatsu
2
250
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
seike460
PRO
2
1.4k
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
360
自分だけの世界を創るクリエイティブコーディング / Creative Coding: Creating Your Own World
chobishiba
2
700
推しの夫に恋のGPS「ときメーター」#M5Stack #IoT #M5JPTour2024
riyu
0
230
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
0
160
Remix × Cloudflare Pages × Sentry 奮闘記 / remix-pages-sentry
nkzn
1
390
perl for shell, awk and sed programmers
mackee
1
610
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
590
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
A Tale of Four Properties
chriscoyier
155
22k
The Invisible Side of Design
smashingmag
297
50k
Optimizing for Happiness
mojombo
375
69k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
125
18k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
327
21k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
105
48k
How GitHub Uses GitHub to Build GitHub
holman
473
290k
Producing Creativity
orderedlist
PRO
341
39k
Fireside Chat
paigeccino
32
2.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
The Brand Is Dead. Long Live the Brand.
mthomps
53
38k
Transcript
Elixir @sasajuric aircloak.com
None
None
otpornost na pogreške skalabilnost responzivnost
Erlang LFE Elixir Erlang VM (BEAM)
None
v1 = f1(p1, p2, ...) v2 = f2(...) ...
spawn(fn -> ... end) A B
OS proces BEAM proces
scheduler scheduler scheduler scheduler BEAM instanca CPU CPU CPU CPU
pid = spawn(fn -> ... end)
pid = spawn(fn -> ... end) send(pid, :ping)
spawn(fn -> receive do :ping -> # ... end end)
send(pid, {:ping, self()})
spawn(fn -> receive do {:ping, caller_pid} -> send(caller_pid, :pong) end
end)
send(pid, {:ping, self()}) receive do :pong -> # ... after
:timer.seconds(5) -> # ... end
pid = spawn(fn -> server_loop(state) end)
defp server_loop(state) do receive do message -> new_state = handle(state,
message) server_loop(new_state) end end
bank account balance
send(pid, {:deposit, 100}) send(pid, {:withdraw, 100}) send(pid, {:balance, self()}) receive
do balance -> # ... end
spawn(fn -> bank_account_loop(0) end)
def bank_account_loop(balance) do receive do {:deposit, amount} -> bank_account_loop(balance +
amount) {:withdraw, amount} -> bank_account_loop(balance - amount) {:balance, caller_pid} -> send(caller_pid, balance) bank_account_loop(balance) end end
bank account {:deposit, amount} {:withdraw, amount} :balance
None
db connection background job request handler state request handler request
handler request handler request handler request handler state state state background job background job background job db connection db connection db connection
A B C D E F
A exit notifikacija B C D E F
S S S W W S W W W S
W W
VM VM VM VM VM
VM send(pid, message) VM 1 send(pid, message) VM 2
elixir-lang.org phoenixframework.org adventofcode.com exercism.io elixirforum.com meetup.com/lambdazagreb/