Good questions. I’ll do my best to answer them.
adam mokan
11

Okay.. I think I’m beginning to see the bit of knowledge that I skipped completely.

What does it mean, in the docs for GenServer, to “register a name” ?

Clearly I could register the GenServer through the Registry, which … Might mean I can find the GenServer by asking the Registry… ?

In other words, the via tuple is an abstraction over talking to the Registry by only providing the static key and the changeable value that we care about, with the Registry returning a PID… Which is why this only works for unique Registries..

So there’s code under the hood of GenServer that will find this as a tuple that begins with GenServer and then, instead of the default behavior (which is, what, to locally register it? Or even just to not register it at all and just return the PID, so the user is responsible for storing it?)

So.. Register a name means.. “to give some unique identifier to this process so it can be found through the ACME API, where ACME is local, :global, or :via something else?

Show your support

Clapping shows how much you appreciated Trevoke’s story.