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
What's the fuss about Phoenix?
Search
Saša Jurić
October 31, 2016
Programming
2
1.1k
What's the fuss about Phoenix?
WebCamp Zagreb, 2016
Saša Jurić
October 31, 2016
Tweet
Share
More Decks by Saša Jurić
See All by Saša Jurić
Such Great Heights, Code BEAM Lite, Amsterdam 2018
sasajuric
0
160
Simplifying systems with Elixir - Belgrade
sasajuric
3
440
Simplifying systems with Elixir
sasajuric
2
560
Metagrokking Elixir
sasajuric
4
280
Solid Ground
sasajuric
15
1.2k
Solid Ground
sasajuric
3
850
Elixir - valentine edition
sasajuric
0
120
Phoenix
sasajuric
1
210
Phoenix
sasajuric
0
110
Other Decks in Programming
See All in Programming
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.1k
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
300
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
Findy Team+ Awardを受賞したかった!ベストプラクティス応募内容をふりかえり、開発生産性向上もふりかえる / Findy Team Plus Award BestPractice and DPE Retrospective 2024
honyanya
0
140
ErdMap: Thinking about a map for Rails applications
makicamel
1
570
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
430
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
390
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
300
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
940
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
560
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
Faster Mobile Websites
deanohume
305
30k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Embracing the Ebb and Flow
colly
84
4.5k
The World Runs on Bad Software
bkeepers
PRO
66
11k
Building Your Own Lightsaber
phodgson
104
6.2k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Visualization
eitanlees
146
15k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Facilitating Awesome Meetings
lara
51
6.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Transcript
What’s the fuss about Phoenix? @sasajuric aircloak.com
Phoenix web framework Elixir programming language Erlang VM written in
runs on
productivity simplicity maintainability interoperability fault-tolerance scalability
Erlang is a programming language used to build massively scalable
soft real-time systems with requirements on high availability. erlang.org
None
None
separate execution no shared memory separate garbage collection cooperation through
communication isolated crashes detectable crashes of other processes
run different "things" separately
scheduler scheduler scheduler scheduler CPU CPU CPU CPU Erlang VM
Node 1 Node 2 Node 3
None
None
DEMO
conn conn your code
conn conn plug
conn log conn handle authenticate authorize fetch session
endpoint conn conn router controller
endpoint conn conn router controller endpoint conn conn router controller
endpoint conn conn router controller
CODE
client server socket
client server
client server join "lobby" send "room:42", "message", payload send "room:42",
"message", payload socket send “lobby", "rooms", payload join "room:42"
socket client channel channel socket client channel channel
import Socket from "phoenix" socket = new Socket("/socket") socket.connect() room
= socket.channel("room:elixir", payload) room.join()
room.push("some_event", payload) room.on("some_event", (payload) => { // ... })
defmodule MyEndpoint do socket "/socket", MySocket # ... end
defmodule MySocket do use Phoenix.Socket transport :websocket, Phoenix.Transports.WebSocket transport :longpoll,
Phoenix.Transports.LongPoll channel "lobby", LobbyChannel channel "room:*", RoomChannel # ... end
defmodule RoomChannel do use Phoenix.Channel def join(topic, payload, socket) do
# ... end def handle_in(event, payload, socket) do # ... end def handle_info(erlang_message, socket) do # ... end end
push(socket, event, payload) broadcast(socket, event, payload) broadcast_from(socket, event, payload)
on_some_ui_event(() => channel.push("user_message", payload)) channel.on("user_message", (payload) => render(payload))
defmodule RoomChannel do # ... def handle_in(event, payload, socket) do
broadcast(socket, event, payload) # ... end # ... end
conference program chat
conference program chat ticket purchasing newsletters ratings raffles administration …
start simple go far
onboarding - getting started guides - Elixir - Phoenix -
elixirforum.com
40% off with code ctwwczg at manning.com https://joind.in/talk/60946