开发者

Erlang / Removing warnings when some behavior callback functions are not implemented

开发者 https://www.devze.com 2023-03-23 07:15 出处:网络
What is the best practice from removing warnings when I don\'t need to implement all the callback functions of a behavior ?

What is the best practice from removing warnings when I don't need to implement all the callback functions of a behavior ?

For instance:

Warning: undefined callback func开发者_如何学Pythontion code_change/3 (behaviour 'gen_event')


The "best" practice is actually to implement stub callbacks, with sensible return values (such as {reply, ok, State} for calls, {noreply, State} for casts and info etc.). This will also ensure stability and compatibility if someone would ever try a code upgrade, for example, on your code.

There is no way to ignore these warnings currently.

0

精彩评论

暂无评论...
验证码 换一张
取 消