[erlang-questions] callback module without behavior definition?
Wed Apr 6 18:46:34 CEST 2011
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)."
It seems to work fine, and the compiler doesn't complain. Are there any
consequences to not having a behavior definition that I am overlooking? My
whole module looks something like...
gen_server:start_link(?MODULE, , ).
My actual use-case here is to have a gen_server that "holds" a named,
read-only ets table for other processes to read. init/1 creates the table
and loads data, and process termination makes the table go away.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions