[erlang-questions] net_kernel:handle_call

Robert Raschke rtrlists@REDACTED
Fri Feb 19 17:07:46 CET 2010


Hello Antonio,

On Fri, Feb 19, 2010 at 2:49 PM, Musumeci, Antonio S <
Antonio.Musumeci@REDACTED> wrote:

> Is it intentional that there is no catch all function declaration in
> net_kernel for handle_call?
>
> gen_server:call(net_kernel, blah).
>
> or
>
> gen_server:call({net_kernel,remoteNode}, blah).
>
> will cause it to exit.
>
> It's handled fine in the case of casts however.
>
>
It is very common for gen_server code to have a

handle_cast(_, State) ->
    {noreply,State}.

if no cast requests are actually implemented, because having no
handle_cast/2 at all leads to a compiler warning for the missing callback.
You'll see the same done for other "unimplemented" gen_server callback
functions like code_change/3 or handle_info/2.

And as you are not meant to use gen_server:call/3 directly, but through a
proper interface function you provide as part of your server implementation,
most handle_call/3 implementation only have clauses for actually implemented
requests.

Robby


More information about the erlang-questions mailing list