[erlang-questions] Erlang way for process-as-library?

Robert Baruch autophile@REDACTED
Mon Feb 5 23:33:23 CET 2007


Hi all,

So I'm fooling around with writing a utility library, but to  
initialize the library takes a little bit of time, needing to read a  
few large files into memory. So my idea was to stick the  
functionality into a process, so that the library could be  
initialized once and then used by the application.

I've added the gen_server behavior to the process. So now my question  
is, what's the Erlang way to start the process? Should I start it  
supervised, with a supervisor running somewhere explicitly, and  
require the user to know that they have to start up a supervisor?  
Should I start it unsupervised, checking in every call to the library  
whether the library is running, and if not, start it?

Help, please :)

Thanks,

--Rob



More information about the erlang-questions mailing list