[erlang-questions] Re: callback module without behavior definition?

Daniel Goertzen dang@REDACTED
Wed Apr 6 20:03:40 CEST 2011


I do want to hook it into a supervisor.  If I use a proc_lib process, it
looks like I would have to implement a message loop and some other
callbacks.

I guess my original question is more about what behavior statements actually
do.  Do they just add compile-time "type" checking, or do they have some
real runtime impact?

Dan.



On Wed, Apr 6, 2011 at 12:35 PM, David Mercer <dmercer@REDACTED> wrote:

> On Wednesday, April 06, 2011, Attila Rajmund Nohl wrote:
>
> > 2011/4/6, Daniel Goertzen <daniel.goertzen@REDACTED>:
> > > One thing that has bothered me about implementing gen_servers is that
> > I have
> > > to create empty stubs for the callbacks that I don't need.  Today I
> > made a
> > > gen_server that only needs init/1, so instead of creating all those
> > stubs I
> > > just commented out the behavior definition "-behavior(gen_server)."
> >
> > Then why bother with gen_server, why not use erlang:spawn_link or
> > proc_lib:spawn_link (if you want fancy crash reports)?
>
> Isn't a gen_server the OTP thing to do?  Hook it into a supervisor and all
> that, too...
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110406/4642318b/attachment.htm>


More information about the erlang-questions mailing list