← WritingTIL

TIL: `pg` vs `pg2` Erlang modules

I started reading up on Erlang's pg module(pg = "process groups", it's not related to Postgres!) recently and kept seeing references to pg2.

This is quite confusing because pg is the newer module that replaces pg2.

From pg.erl's initial commit message:

Replacement for pg2 module. Differences (compared to pg2):

* non-existent and empty group treated the same (empty list of pids),

thus create/1 and delete/1 have no effect (and not implemented).

which_groups() return only non-empty groups

* no cluster lock required, and no dependency on global

* all join/leave operations require local process (it's not possible to join

a process from a different node)

* multi-join: join/leave several processes with a single call


More writing

Full archive
  1. Standalone OpenAI transcription Python script
    Writing · #python— runs cleanly with uv run — no virtualenv needed
  2. Running ML models in Elixir using Pythonx
    Writing · #elixir— Pythonx embeds Python right inside the BEAM
Type to filter posts & pagesFull search page →