module dependency and loading order

Hi Forum,
I'm facing a problem and I don't know how to solve it.
I have two modules, let's call them "mod1" and "mod2".
mod2 needs to have mod1 up and running because it uses few exported functions from it. Everything is fine when I load these modules manually (because I decide the loading order) but the problem arises when I start/restart the whole ejabberd daemon. Is there a way to decide the loading order or on mod2 wait until mod1 becomes available ?
I have tried to do it on mod2 into init/2 function but the entire ejabberd loading process waits and mod1 cannot be loaded before mod2.
Is there a way to do it ? some kind of dependencies ? can someone please give me an hint or some docs about this ?

Thank you in advance

Regards
Ben

Replying to myself... After a

Replying to myself...
After a quick chat on #slack and few tests of mine I have discovered the loading order, it seems to be related to module names.
So: briefly, if you want to have dependent modules you need to name them with an alphabetical order.
Now there's even a feature request about it: https://github.com/processone/ejabberd/issues/1191 . We'll see what happens with it, until then the alpha order is important

Ben

Syndicate content