SlideShare a Scribd company logo
Submit Search
Upload
Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
Report
Elixir Club
Elixir Club
Follow
•
0 likes
•
296 views
1
of
29
Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
•
0 likes
•
296 views
Download Now
Download to read offline
Report
Devices & Hardware
Elixir Club 10 March 17, 2018 Kyiv
Read more
Elixir Club
Elixir Club
Follow
Recommended
10x Command Line Fu
Anthony Bui
360 views
•
28 slides
Syncing up with Python’s asyncio for (micro) service development, Joir-dan Gumbs
Pôle Systematic Paris-Region
2.4K views
•
33 slides
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
Mykola Novik
3.5K views
•
22 slides
BUILDING APPS WITH ASYNCIO
Mykola Novik
712 views
•
39 slides
Es.next
Ignacio Gil
279 views
•
58 slides
aiohttp intro
Anton Kasyanov
1.8K views
•
32 slides
More Related Content
What's hot
Visualizing ORACLE performance data with R @ #C16LV
Maxym Kharchenko
1.7K views
•
54 slides
10 tips for making Bash a sane programming language
Yaroslav Tkachenko
764 views
•
20 slides
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
Puppet
1.7K views
•
13 slides
Fun with exploits old and new
Larry Cashdollar
432 views
•
31 slides
How to discover 1352 Wordpress plugin 0days in one hour (not really)
Larry Cashdollar
1.8K views
•
35 slides
Fake My Party
Tanja Otto
1.2K views
•
21 slides
What's hot
(19)
Visualizing ORACLE performance data with R @ #C16LV
Maxym Kharchenko
•
1.7K views
10 tips for making Bash a sane programming language
Yaroslav Tkachenko
•
764 views
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
Puppet
•
1.7K views
Fun with exploits old and new
Larry Cashdollar
•
432 views
How to discover 1352 Wordpress plugin 0days in one hour (not really)
Larry Cashdollar
•
1.8K views
Fake My Party
Tanja Otto
•
1.2K views
Ansible for beginners ...?
shirou wakayama
•
5.9K views
Node.js
Mat Schaffer
•
823 views
Git::Hooks
Mikko Koivunalho
•
875 views
以 Laravel 經驗開發 Hyperf 應用
Shengyou Fan
•
2.1K views
Machine learning on source code
source{d}
•
540 views
Ansible tips & tricks
bcoca
•
24.1K views
MeshU Thin & Rack
guestbac5dc
•
1.5K views
Cooking with Chef
Orlando_Ruby_Users_Group
•
743 views
New ES6 Hotness
Pawel Szymczykowski
•
907 views
Effective ES6
Teppei Sato
•
52.2K views
Yaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery
Elixir Club
•
394 views
Ansible, Simplicity, and the Zen of Python
toddmowen
•
831 views
Introduction to Retrofit
Kazuhiro Serizawa
•
3.1K views
Similar to Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
Echtzeitapplikationen mit Elixir und GraphQL
Moritz Flucht
409 views
•
35 slides
Building Google-in-a-box: using Apache SolrCloud and Bigtop to index your big...
rhatr
2.5K views
•
43 slides
Elixir
Robert Brown
3.6K views
•
36 slides
Container (Docker) Orchestration Tools
Dhilipsiva DS
441 views
•
25 slides
Cosmos, Big Data GE implementation in FIWARE
Fernando Lopez Aguilar
3.5K views
•
52 slides
Cosmos, Big Data GE Implementation
FIWARE
1.3K views
•
52 slides
Similar to Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
(20)
Echtzeitapplikationen mit Elixir und GraphQL
Moritz Flucht
•
409 views
Building Google-in-a-box: using Apache SolrCloud and Bigtop to index your big...
rhatr
•
2.5K views
Elixir
Robert Brown
•
3.6K views
Container (Docker) Orchestration Tools
Dhilipsiva DS
•
441 views
Cosmos, Big Data GE implementation in FIWARE
Fernando Lopez Aguilar
•
3.5K views
Cosmos, Big Data GE Implementation
FIWARE
•
1.3K views
Erlang sucks. EUC 2012
Dmitrii Dimandt
•
2.1K views
Building web framework with Rack
sickill
•
3.6K views
Transforming WebSockets
Arnout Kazemier
•
5.4K views
Shell scripting - By Vu Duy Tu from eXo Platform SEA
Thuy_Dang
•
1.3K views
Node intro
cloudhead
•
919 views
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
BGA Cyber Security
•
2K views
Infrastructure as Code: Introduction to Terraform
Alexander Popov
•
685 views
Diseño y Desarrollo de APIs
Raúl Neis
•
153 views
Next Generation DevOps in Drupal: DrupalCamp London 2014
Barney Hanlon
•
2.9K views
Great Developers Steal
Ben Scofield
•
1.7K views
Ecto and Phoenix: Doing web with Elixir - Yurii Bodarev
Elixir Club
•
671 views
Ecto and Phoenix: Doing Web With Elixir
Yurii Bodarev
•
204 views
extending-php
tutorialsruby
•
369 views
extending-php
tutorialsruby
•
2K views
More from Elixir Club
Kubernetes + Docker + Elixir - Alexei Sholik, Andrew Dryga | Elixir Club Ukraine
Elixir Club
627 views
•
18 slides
Integrating 3rd parties with Ecto - Eduardo Aguilera | Elixir Club Ukraine
Elixir Club
394 views
•
38 slides
— An async template - Oleksandr Khokhlov | Elixir Club Ukraine
Elixir Club
394 views
•
37 slides
BEAM architecture handbook - Andrea Leopardi | Elixir Club Ukraine
Elixir Club
326 views
•
108 slides
You ain't gonna need write a GenServer - Ulisses Almeida | Elixir Club Ukraine
Elixir Club
561 views
•
86 slides
— Knock, knock — An async templates — Who’s there? - Alexander Khokhlov | ...
Elixir Club
342 views
•
41 slides
More from Elixir Club
(20)
Kubernetes + Docker + Elixir - Alexei Sholik, Andrew Dryga | Elixir Club Ukraine
Elixir Club
•
627 views
Integrating 3rd parties with Ecto - Eduardo Aguilera | Elixir Club Ukraine
Elixir Club
•
394 views
— An async template - Oleksandr Khokhlov | Elixir Club Ukraine
Elixir Club
•
394 views
BEAM architecture handbook - Andrea Leopardi | Elixir Club Ukraine
Elixir Club
•
326 views
You ain't gonna need write a GenServer - Ulisses Almeida | Elixir Club Ukraine
Elixir Club
•
561 views
— Knock, knock — An async templates — Who’s there? - Alexander Khokhlov | ...
Elixir Club
•
342 views
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Elixir Club
•
489 views
Erlang cluster. How is it? Production experience. — Valerii Vasylkov | Elixi...
Elixir Club
•
306 views
Promo Phx4RailsDevs - Volodya Sveredyuk
Elixir Club
•
128 views
Web of today — Alexander Khokhlov
Elixir Club
•
256 views
ElixirConf Eu 2018, what was it like? – Eugene Pirogov
Elixir Club
•
275 views
Implementing GraphQL API in Elixir – Victor Deryagin
Elixir Club
•
983 views
WebPerformance: Why and How? – Stefan Wintermeyer
Elixir Club
•
576 views
GenServer in Action – Yurii Bodarev
Elixir Club
•
624 views
Russian Doll Paradox: Elixir Web without Phoenix - Alex Rozumii
Elixir Club
•
139 views
Practical Fault Tolerance in Elixir - Alexei Sholik
Elixir Club
•
299 views
Monads are just monoids in the category of endofunctors - Ike Kurghinyan
Elixir Club
•
154 views
Craft effective API with GraphQL and Absinthe - Ihor Katkov
Elixir Club
•
1K views
Elixir in a service of government - Alex Troush
Elixir Club
•
187 views
Pattern matching in Elixir by example - Alexander Khokhlov
Elixir Club
•
315 views
Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
1.
Александр Хохлов @nots_io Phoenix and
beyond: Things we do with Elixir
2.
Founder at Nots.io http://nots.io
6.
Why this talk?
7.
In the beginning…
8.
Phoenix: Web Sockets, HAML,
SASS
9.
Guardian, Arc, ex_aws,
Swoosh, ueberauth/ueberauth_github
10.
RethinkDB rethinkdb_changefeed postgrex
11.
https://github.com/h4cc/ awesome-elixir
12.
http://obolinx.com/resources/?p=1837
13.
Erlang/Elixir port to
Java process with JInterface
14.
https://www.safaribooksonline.com/library/view/erlang-programming/9780596803940/ch16s05.html
16.
def init(_params) do
cd = “#{:code.priv_dir(:your_app)}" cmd = "java -jar package.jar" port = Port.open({:spawn,cmd}, [:binary, :use_stdio, packet: 4, cd: cd]) true = Port.connect(port, self()) {:ok,port} end Port.command(port, :erlang.term_to_binary(data)) def handle_info({port,{:data,b}}, port) do data = :erlang.binary_to_term(b) end
17.
Postgrex.Notifications + GenServer
19.
PLPGSQL: PERFORM pg_notify(‘invitations_changes’, payload) Elixir: {:ok,
pid} = Postgrex.Notifications.start_link(config) Postgrex.Notifications.listen(pid, "invitations_changes") def handle_info({:notification, _pid, _ref, "invitations_changes", payload}, state) do … end
21.
API: HTTP API with Poison
& HTTPoison
22.
HTTPoison.put(url, Poison.encode!(data)) HTTPoison.get(url)
HTTPoison.post(url, Poison.encode!(data))) case resp do {:ok, %HTTPoison.Response{status_code: 200, body: body}}-> {:ok, body |> Poison.decode!} {:ok, %HTTPoison.Response{status_code: 404}} -> {:error, :not_found} {:ok, %HTTPoison.Response{body: body}} -> {:error, body |> Poison.decode!} {:error, %HTTPoison.Error{reason: reason}} -> {:error, reason} end
23.
API: Socket API with
gen_tcp
25.
# receive tcp
packet as message {:ok, socket} = :gen_tcp.connect('localhost', port, [:binary, active: true]) def handle_info({:tcp, _socket, msg}, state) do ... end # receive tcp packet with recv :inet.setopts(socket, active: false) :ok = :gen_tcp.send(socket, data) {:ok, <<_msg_len :: binary - size(16), msg :: binary>>} = :gen_tcp.recv(socket, 0, 2000)
26.
Concurrent tasks
27.
results = notes
|> Task.async_stream(__MODULE__, :update, [some, params], max_concurrency: 20) |> Enum.to_list |> Keyword.get(:ok) def update(note, some, params) do ... end
29.
point@nots.io http://nots.io http://blog.nots.io @nots_io facebook.com/nots.io