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 - valentine edition
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Saša Jurić
February 14, 2017
Programming
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Elixir - valentine edition
Saša Jurić
February 14, 2017
Transcript
31 slides
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/
More Decks by Saša Jurić
See All by Saša Jurić
Such Great Heights, Code BEAM Lite, Amsterdam 2018
sasajuric
0
220
Simplifying systems with Elixir - Belgrade
sasajuric
3
500
Simplifying systems with Elixir
sasajuric
2
630
Metagrokking Elixir
sasajuric
4
350
Solid Ground
sasajuric
15
1.3k
Solid Ground
sasajuric
3
960
What's the fuss about Phoenix?
sasajuric
2
1.2k
Phoenix
sasajuric
1
310
Phoenix
sasajuric
0
170
Other Decks in Programming
See All in Programming
SODA - FACT BOOK(EN)
sodainc
1
240
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
230
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
3
1.7k
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
290
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
320
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
130
はじめてのPLATEAU
nokonoko1203
1
650
Spec-driven Development with AI
simas
PRO
0
2.3k
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
330
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
130
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
860
SODA - FACT BOOK(JP)
sodainc
1
40k
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Automating Front-end Workflow
addyosmani
1370
210k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
430
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Mind Mapping
helmedeiros
1
440
ラッコキーワード サービス紹介資料
rakko
5
5.8M
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Building AI with AI
inesmontani
PRO
1
1.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k