-----Star topological fractal design of distributed design mode of Golang

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

-----Star topological fractal design of distributed design mode of Golang

In the previous layered design, the simple design of the state transfer was realized by using the simple pipelining principle.

We will consider another case in this article. For example, process management in the Linux kernel. All processes have a parent process. When a child process is running normally, there is basically no communication with the parent process. However, when a child process dies, it notifies its parent process to have the parent process recycle the resource. When the parent process dies, either way, the child process dies with the parent process, or the child process is managed by the parent process of the parent process.

Each of these processes has its own parent process and may have its own child process.

In this kind of management, the parent-child relationship, or the relationship between the manager and the manager. By the manager, can run alone, but some of its status to inform the manager, or managers, can regularly get the status of the manager.

The following is an example of a peer downloader:

First, the division of functions, the formation of managers and managers

1) Download Task Manager. (for adding, deleting tasks, and controlling the download speed of tasks and other policy management)

2) Download the task module. (For specific individual task downloads, you can control peer)

3) Peer module. (Peer interaction peer communication, data interaction)

There are two star topology models here.

1) Download Task Manager for Manager, control task Add, delete etc. Download the task module, for the manager, for a specific task to download.

Download Manager, you can control the download module in real time, download module, download speed, download completed and other status to the download management escalation.

2) Download the task module, for the manager, control peer to acquire, create and so on. Peer peers module, for the manager, for specific communication, data interaction and so on.

Its two star-shaped structure, composed of a star-shaped fractal structure

Second, the definition of the interface

1) The manager, who defines a manager's interface, is used to pass it on to the manager.

2) by the manager, define a state interface, for the manager to obtain and control the state of the manager.

Third, the operation

1, the manager initializes, and runs

2, added by the manager.

When added, the management interface is passed to the manager.

The fractal design of star topology can belong to a system based on functional management division. Each function is independent, and through the interface, carries on the weak communication, realizes the escalation, the management and so on behavior. But each function can be loosely coupled.

First draft of Hao

QQ 29185807

August 22, 2014

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.