[erlang-questions] Module-Function-Arguments (MFA)
Fri Jun 26 17:51:51 CEST 2015
I need to implement a "service" functionality which allows the "client" to
implement callbacks (from service into client's module) which it wishes to
I accept the module name as parameter from the client and mandate the
function names (callbacks) and parameters thereof which the client may
define in its module.
Suppose one of the callback names is 'handle_tick', and the module name
supplied by the client is held in variable 'Module' in my service
How do I verify whether client has implemented the function handle_tick()
in its module? Or, do I just invoke it and handle the exception using
PS: I observe that the web sockets functionality in Yaws uses similar
mechanism to invoke callbacks in client's module. But, digging into Yaws'
source code is a little too overwhelming for me :-(
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions