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
400
Simplifying systems with Elixir
sasajuric
2
540
Metagrokking Elixir
sasajuric
4
280
Solid Ground
sasajuric
15
1.1k
Solid Ground
sasajuric
3
770
What's the fuss about Phoenix?
sasajuric
2
980
Phoenix
sasajuric
1
200
Phoenix
sasajuric
0
110
Other Decks in Programming
See All in Programming
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
10
1.7k
WebGLで始める コンピュータグラフィックス入門
heller77
0
350
Going beyond Apache Parquet's default settings
xhochy
0
140
AmperとFleetを使ったAndroidアプリ
yoppie
0
280
Micro Frontends for Java Microservices - Utah JUG 2024
mraible
PRO
1
110
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
870
SIMD Parallel Programming with the Vector API
josepaumard
0
240
slow types ってなんだろう?
karad
0
180
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
480
Compose-View Interop in Practice (mDevCamp 2024)
stewemetal
0
170
JavaScript Closure
asoluka
0
1.3k
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
4
550
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
117
18k
YesSQL, Process and Tooling at Scale
rocio
165
13k
What the flash - Photography Introduction
edds
64
11k
The Art of Programming - Codeland 2020
erikaheidi
43
12k
The Pragmatic Product Professional
lauravandoore
26
5.8k
Building an army of robots
kneath
300
41k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.6k
Being A Developer After 40
akosma
67
580k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
660
120k
Docker and Python
trallard
35
2.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
126
32k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
358
22k
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/