What does ":alias" in "[:alias, Ref<>]" mean in a GenServer callback?

Per the docs for GenServer callbacks, we receive 3 arguments, request, from and state.

request is the request message sent by a call/3, from is a 2-tuple containing the caller’s PID and a term that uniquely identifies the call, and state is the current state of the GenServer.

When inspecting the “term that uniquely identifies the call”, I get [:alias | #Reference<...>], I was expecting just a a #Reference as that’s returned for other things that are being (almost) unique.

I’m not sure where to find more information on what :alias means, it’s kind of hard to search for. Can it have other values? I think the docs imply you’re supposed to treat the value as basically an opaque type but I’m curious why a reference on its own isn’t good enough.

1 Like

Aliases are a recent addition to otp to deal with late responses (after a timeout) and handling them. Erlang/OTP 24 Highlights - Erlang/OTP