[erlang-questions] Why application:start can not accept any args?
Lihe Wang
wanglihe.programmer@REDACTED
Sun Jul 12 15:19:06 CEST 2015
Can any one give the explain about OTP? The application behaviour's call
back "start" need args, but when I want start my code as a real
application, I only can write "applicaion:start(mycode)", and can not pass
any args to mycode. Why otp design like this? When I want start a
application as background service from escript, for example:
main([Arg1, Arg2, Arg3]) ->
application:start(mycode1), %%with Arg1
application:start(mycode2), %%with Arg2
workcode(Arg3). %%workcode (escript) will run as a daemon, and need
service supplied by mycode1 and mycode2.
What is the right way to write these code?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150712/92f4444a/attachment.htm>
More information about the erlang-questions
mailing list