3. Basic knowledge, Erlang application-erlang/opt standard behavior simple case

Source: Internet
Author: User

1.application definition .  Illustration: Mnesia, cowboy, Mochiweb ... is a application.      does not affect each other in Erlang, which causes a process to crash and B processes that do not rely on the a process to function properly. And since Erlang's mechanism causes it to know the a process crashes, then if you can restart the A-process, then this system: I tell you, it's a perpetual system, "Who's so wasted that they don't have electricity at night"-by a machine darkroom.     Application, is used to do the work of this restart process.     application can be seen as an official feature that can be used to ensure that the code you write is able to revert to its original state when a problem occurs, and that the behavior is self-defined.     For example, the application can restart the process immediately (the data stored in the process disappears) because the bug causes the program to crash  2.application the directory structure. The following is an example of creating a "server-side Listener port" application. The root directory of the "server-side listener port" app is defined as server/    server/src    server ebin       server/include    server/doc    server/priv/docroot 3. In this "server-side Listening port" application, As with the application name, the features we implement include:    a. Start a listening port     B. The client can send data to this interface on the server     C. The server receives the data, performs the corresponding operation, sends the result back to the client after the operation is completed     D. Customer-close connection, service-side cleanup the content that the  4.application template must contain. Server_app.erl% Standard Template server_sup.erl % Standard template server.app % Standard template Server_manager.erl% actually we function modules, module names can be arbitrary, To maintain consistency, use the name  5. The main purpose of this sectionIs that a game suit is composed of multiple applicatin to ensure its stability  6. All code files, put on the website: GitHub

3. Basic knowledge, Erlang application-erlang/opt standard behavior simple case

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.