I want to extend gen_server
(create a gen_server_extra
) with some additional functionality. The requirements are:
- The
gen_server_extra
processes should behave like a regulargen_server
's. E.g, they should accept calls viagen_server:call
, integrate with SASL, fit OTC supervision tree, etc. gen_server_extra
processes should have an additional functionality, provided bygen_server_extra
. That basically means some of the messages will be handled bygen_server_extra
code, without passing them to the callback module. The rest of the messages are passed to callback module as is.gen_server_extra
functionality requires its own state which should be hidden from the callback module.
What is the simplest approach to do that?