[erlang-questions] Applications, supervisors and supervisors, oh my

Bernard Duggan bernie@REDACTED
Tue May 25 01:03:04 CEST 2010


On 24/05/2010 10:28 PM, David Welton wrote:
> What I'm wondering is if this should be an "application".  I want it
> to be restarted if it dies, so adding a supervisor makes sense.  I'm
> not quite sure where applications fit in in terms of API's though...
> many that I've seen don't present much of an API, though: start/stop,
> and not a lot of ways of interacting with whatever's under the hood
> (or so it seems, perhaps I'm mistaken).
>   
It being an 'application' does not inherently limit your interactions
with it.  Mnesia, for example, is an application and nobody would
suggest you can't interact with it.  For example, you can still talk to
any registered processes within that application using their name.  All
(well, not all, but for the purposes of this discussion) an application
provides is a way to start/stop a defined set of processes.  If you want
them to be supervised, the application in turn needs to start the worker
processes within a supervisor - applications themselves don't provide
any fault tolerance.

Cheers,

Bernard



More information about the erlang-questions mailing list