[erlang-questions] supervisors & slow init's

David Welton davidnwelton@REDACTED
Wed Dec 4 18:35:29 CET 2013

> I need to start up something, hardware, say, that takes a while to
> initialize, via an external process.  The next child of my supervisor
> should not start until the first, slow one does.   How should I go
> about notifying Erlang that things are done?  Currently, the external
> system connects as an external node and sends a message.  Can I have a
> receive in the gen_server's init to wait for that?

Initial tests show that it does work, both with a pid, and with the
name of the server.

Whether it's the best thing to do or not is not something I'm sure of.
 If I have a 'ready' callback that receives a message from the
hardware driver, how do I only then start up the other gen_servers
under the supervisor - just do it dynamically?  Seems a bit roundabout
compared to just starting everything in the right order.

David N. Welton



More information about the erlang-questions mailing list