[erlang-questions] inets and ssl start/1 stop/1

fess fess-erlang@REDACTED
Thu Jan 15 18:02:48 CET 2009


On Jan 14, 2009, at 11:44 AM, Claes Wikström wrote:

> Edward Stow wrote:
>> Hi
>>
>> Within a yaws application  I am start/1 ing inets and ssl to send a
>> post request to an external server.
>>
>> Should I be stopping these services when my request returns.
>>
>> I assume that for each yaws request a new process is started and that
>> the inets ssl services are stopped when the process exits.
>>
>
> Don't stop anything.
>
> /klacke


inets and ssl are other erlang applications like yaws. [ ie, when you  
start them you are starting other processes in the supervision tree of  
the application controller and not likely to be linked to your current  
process which is handling the request, and not likely to stop until  
told to. ]  Since you're using inets and ssl  you generally you want  
to get them started when you start all your  applications [ not on  
every web request. ] Yaws can help here.  Yaws is also a container for  
starting up erlang itself and the relevant erlang applications,  
[ assuming you're not using embedded mode. ] to this end it has a  
mechanism  in it's config file called runmod where you can list inets  
and ssl.  And then yaws the container will start erlang, and start  
your runmods, and start everything that it needs running.

http://yaws.hyber.org/yman.yaws?page=yaws.conf

        runmod = ModuleName
               At startup yaws will invoke  ModuleName:start()  in  a   
separate
               process. It is possible to have several runmods.  This  
is useful
               if we want to reuse the yaws startup shell script  for   
our  own
               application.



I hope that clarifies things.  [ and I hope I said that all right. :D ]


--fess






More information about the erlang-questions mailing list