简体   繁体   中英

How to run an Erlang application under the supervisor

What does it mean to run an Erlang application under the supervisor? If there are any examples how to make it, could you please show it.

It means you should create a top level supervisor that makes sure parts of your application are restarted if they crash.

The exact topology of your application depends on what you're trying to do (how many processes, what they do and what their relationship is). For applications that are not trivial you might want to create a top level supervisor and then further supervisors responsible for the different processes or process groups.

The most common for simple applications is to create an application, and to make your application start a supervisor which in turn starts up one or more worker children. If you use rebar to create your project that will by default create the stubs for this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM