Elixir のプロセスを学習する際, 予めプロセス関連のモジュール郡の関係性を大雑把に理解していた方が, 記憶定着が良いであろうと考え, このスライドを作成しました. 主に, Task, GenServer, Agent, Supervisor, DynamicSupervisor, Task.Supervisor, Registry などを解説しています.
Elixir のプロセスを学習する際, 予めプロセス関連のモジュール郡の関係性を大雑把に理解していた方が, 記憶定着が良いであろうと考え, このスライドを作成しました. 主に, Task, GenServer, Agent, Supervisor, DynamicSupervisor, Task.Supervisor, Registry などを解説しています.
上の表から(期待通り)ppgの方が、ノード数が増えた場合でもメンバ追加の性能劣化度合いが少ない、ことが見てとれる。 ※ 理屈上は、クラスタサイズに依存せずに定数コストでのノード追加・削除が可能なはず。 ※ 今回の測定でノード数が増えるに従って、微妙に処理時間が長くなっているのは、全ノードを同一マシン上で起動しているためだと思われる (ノード数が増えるほどマシン自体に掛かる負荷が増える) 反対に、pg2はノード数に比例する形で処理時間が伸びているように見える。 また、pg2は並行的にメンバを追加した場合に(逐次的に行った場合に比べて)性能が劣化しているのに対して、ppgでは逆に並行版の方が性能が向上しているのも面白い。 なお、一応公平を期すために書いておくと、グループ構成の変更(メンバ追加・削除)の場合とは反対に、メンバへのメッセージのブロードキャスト時のコストに関しては、pg2の方が基本的
Printed process ids < A.B.C > are composed of 6: A, the node number (0 is the local node, an arbitrary number for a remote node) B, the first 15 bits of the process number (an index into the process table) 7 C, bits 16-18 of the process number (the same process number as B) 7 Internally, the process number is 28 bits wide on the 32 bit emulator. The odd definition of B and C comes from R9B and ear
I have code like: PID = spawn_link(DistrNode, ...... io:format("~p debug1 ~n",[PID]), io:format("~p debug2 ~n",[pid_to_list(PID)]), and I get like: <10062.97.0> debug1 "<9453.97.0>" debug2 I want grab PID as string but not change value like it did above- what is happening here? I looked convert pid to atom, but no function there. I wanted to get "<10062.97.0>" EDIT it spawn_link() not spawn() this
Erlang's Internal Data Representation Jun 28 th , 2016 5:12 pm I find it interesting how the Erlang BEAM engine represents data in memory. Quick look: An Erlang list This is the in-memory layout of the Erlang list "phi" . [112, 104, 105] As a reminder, Erlang treats a string as a list of small integers; 'p' , for instance, is 112 . Don’t worry too much about the bitwise details of the diagram - we
<iframe src="https://slide.rabbit-shocker.org/authors/niku/yapc-hokkaido-2016-eve-naruhodo-erlang-process/viewer.html" width="640" height="524" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border: 1px solid #ccc; border-width: 1px 1px 0; box-sizing: content-box; margin-bottom: 5px" allowfullscreen> </iframe> <div style="margin-bottom: 5px"> <a href="https://slide.rabbit-s
Elixir/Erlang concurrency model is based on the actor pattern which runs on top of BEAM(Erlang Virtual Machine) instead of running directly on Operating System. The actor pattern’s actor is an “Elixir Process” in Elixir programming language. Anatomy of an actor (Elixir/Erlang Process)An Elixir/Erlang Processruns on top of BEAM (Erlang Virtual Machine)has an address (pid)is a completely isolated pr
Expand All Contract All Chapters Introduction Top of chapter Purpose Prerequisites Document Conventions Complete List of BIFs Reserved Words Character Set and Source File Encoding Top of chapter Character Set Source File Encoding Data Types Top of chapter Terms Number Atom Bit Strings and Binaries Reference Fun Port Identifier PID Tuple Map List String Record Boolean Escape Sequences Type Conversi
I recently started working on a Phoenix project at Infinite Red that uses Elasticsearch to power a search feature. In our development environments, we needed a good way to ensure that Elasticsearch was running whenever Phoenix was running. Obviously, there are a lot of ways we could do this. We could, for example, have everyone install Elasticsearch through Homebrew with “brew install elasticsearc
The pg2 module is deprecated as of OTP 23 and scheduled for removal in OTP 24. You are advised to replace the usage of pg2 with pg. pg has a similar API, but with an implementation that is more scalable. See the documentation of pg for more information about differences. This module implements process groups. Each message can be sent to one, some, or all group members. A group of processes can be
We have been evaluating Elixir at Codemancers and today I was learning how to spin up a minimal HTTP API endpoint using Elixir. Like Rack in Ruby land, Elixir comes with Plug, a swiss army knife for dealing with HTTP connections. Using Plug to build an HTTP endpoint First, let's create a new Elixir project:
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く