精選文章
A digital symphony — The architecture of API Fortress.
使用Actor模型來支持基於微服務的大規模分佈式軟件架構。用實例解釋了Actor對於分解複雜系統的好處。
Understanding actor concurrency, Part 1: Actors in Erlang。
但也觀點說Actor並不是好的併發模型,Actors are not a good concurrency model。RabbitMQ 3.8 Release Overview.
支持Prometheus and Grafana 監控。我最近打算用Elixir從零寫一個HTTP(S) 壓力測試工具,前端展示本來是想用Phoenix LiveView來做展示的,但看到這個後,直接替換成Grafana,省掉了非常多的工作,且更圖表更專業。Elixir HTTP Benchmark - Ace vs Cowboy.
HTTP Server簡單壓測結果。圖中cowboy-static的靜態頁面請求比自己想象中的慢很多。Clever use of persistent_term.
比ets:update_counter更快的自增操作!內存分配策略更佳,新版本的logger就是使用的它。····- Erlang, pattern matching on a particular map's key?
解釋了爲什麼下面map的匹配模式是編譯不過的。
count([], Acc) -> Acc;
count([A|Rest], #{A := N} = Acc) -> count(Rest, Acc#{A := N+1});
count([A|Rest], Acc) -> count(Rest, Acc#{A := 1}).
)