ityonemo

ityonemo

I’m doing a 7-part screencast that deep-dives into how Elixir (yup, that’s elixir, not erlang) does processes.

Prerequisites are understanding Elixir syntax, content ranges from beginner to “ready to become and advanced Elixir programmer”.

Showing Posts 11 to 20

Exadra37

Exadra37

Not wanting to hijack the post, but if I am not in mistake @josevalim said once that most probably we wouldn’t have an Elixir V2.0, but after all it seems to be planned one???

LostKobrakai

LostKobrakai

There are a bunch of those comments in elixir core, but I guess not because it’s planed, but because it’s useful if it eventually becomes an option.

RudManusachi

RudManusachi

Huh, right! Thank you for clarifying! Tried on simple example it worked as expected!

In the project I’m working on turned out the issue was in a different module where async processing is implemented via GenServer handle_info.. I misread the error message

Thank you for bringing it up here! :heart:
I just replaced stateless GenServers with supervised tasks and tested with Mox with async: true (yay!)

ityonemo

ityonemo OP

Each time someone changes a linear-flow GenServer to a Task, an angel gets their wings lol.

Aetherus

Aetherus

I heard that some part of the Phoenix framework is some processes that are not GenServers but still can be supervised by a supervisor. I wonder what’s the minimal requirement to make a process that can be supervised.

LostKobrakai

LostKobrakai

There are many non GenServer processes, which can be supervised: Task, :gen_statem and some other :gen_* behaviours. Basically there are plain processes, which are just barebone, then there are processes spawned by :proc_lib, which also adhere to OTP design principles and then there are higher level abstractions and behaviours, which often use :proc_lib internally. Those last ones are the tasks, genservers, statemachines, ….

Aetherus

Aetherus

Then how many messages should a process be able to handle so that it can be supervised? None?

Also, what messages should a supervised process be able to spit out? On what condition?

LostKobrakai

LostKobrakai

Those things are afaik documented in the docs for :proc_lib/:sys, like here:

sys and proc_lib — Erlang System Documentation v29.0.2

Not sure if there’s more, I never did a deep dive into the topic.

Aetherus

Aetherus

Thanks a lot for the documentation. That’s fascinating. I’ll give it a shot (in Elixir, of course) this weekend.

ityonemo

ityonemo OP

I’m pretty sure the only requirement is that you be able to launch the child process with some MFA that returns one of {:ok, pid}, {:error, reason}, or :ignore, where pid is linked.

Tasks don’t emit messages, so that’s not a requirement. Nor do they accept messages, except for brutal_kill messages (that’s built into the VM, so no need to write any code for it). You can choose to handle a soft kill message, but that is optional, because a supervisor knows to brutal_kill after the grace period.

Also note that DynamicSupervisor is elixir only.

Where Next? Top

Trending in Screencasts Top

Potions
A new screencast on moving a blocking HTTP fetch into an Oban job. Part 1 of 2. Screencast + full walkthrough:
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews