Choosing Between GenServer and Spawned Processes for Erlang State Management
Deciding between GenServer and spawned processes in Erlang involves balancing overhead against operational stability. This guide compares both for state management.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Deciding between GenServer and spawned processes in Erlang involves balancing overhead against operational stability. This guide compares both for state management.
Learn how Erlang’s Let it Crash philosophy uses supervision trees to isolate faults, restart workers safely, and keep systems self‑healing without complex defensive code.
When an Erlang release fails during deployment, the default error_logger output goes to the console and can be lost if the node terminates abruptly. To diagnose the failure later, I need to capture error_logger events in a file that survives node crashes and is available for offline inspection. Using error_logger:logfile/1 redirects logs to a file, but I am
In Erlang/OTP, using a `gen_server` to manage connection pools can lead to intermittent exhaustion when downstream dependencies experience latency. While the process remains active, the `gen_server` loop lacks a native timeout for individual message processing. If a request handler blocks on external I/O, the process cannot consume subsequent messages, causi
Gleam provides a strong, static type system that compiles to Erlang, allowing developers to leverage the BEAM ecosystem. While Gleam ensures exhaustiveness and type safety within its own modules, interacting with existing Erlang libraries introduces dynamic boundaries where static guarantees are not natively maintained. When calling untyped Erlang functions,
Gleam compiles to Erlang bytecode, so its long‑running processes are subject to BEAM’s garbage collector. A community‑reported leak in the standard library’s map implementation can cause heap size to grow steadily, even though the code itself never retains explicit references. The proposed fix replaces mutable maps with copy‑on‑write semantics, which has sho
When processing large datasets using the stream_code module, the goal is to maintain a constant memory footprint by avoiding loading the entire set into the heap. While the module allows for lazy evaluation, the behavior of the garbage collector and process heap growth during long-running stream transformations can be unpredictable. Standard tail-call optimi
Symptom A module compiled with the -export_all attribute makes every function publicly callable, even those meant to stay internal. The compiler emits no warning, so the exposure can go unnoticed until another module or an external caller invokes a private function via erlang:apply/3 . Constraints and uncertainty Current OTP releases (26, 27) still support -
Goal: Determine whether an Erlang/OTP application can distinguish a DNS resolution outcome from a TLS certificate validation failure when connecting to a hostname that resolves to multiple addresses. The inet application may return several IPv4 and IPv6 records for one name, while the ssl application performs certificate verification only after a TCP/TLS han