"Firefly API New Document" Package distributed

Source: Internet
Author: User
Tags addchild

Package distributed this packet mainly encapsulates the method of communication between the various service processes. The interface calls in the root root node process of node child nodes return all deferred objects. For the use of deferred objects, see deferred objects in twisted.
The CALSS child child object corresponds to a service process object that is connected to the service process. Called a child node object.
GetName gets the name of the child node
    1. Type method
    2. CWD firefly/distributed/child.py
    3. Params GetName ()
    4. Returns the name of the node
Copy CodeSettransport Setting the channel of a child node
    1. Type method
    2. CWD firefly/distributed/child.py
    3. Params Settransport (transport)
Copy Codeexample of transport proxy channel instance type
Callbackchild the interface of the back tone node
    1. Type method
    2. CWD firefly/distributed/child.py
    3. Params Allbackchild (*ARGS,**KW)
Copy CodePasses the parameter *args,**kw into the Callchild method, returning the deferred object waiting for Callchild to return the result

Class Childsmanager child node management base class
Getchildbyid Get node instance "based on Node ID"
    1. Type method
    2. CWD firefly/distributed/manager.py
    3. Params Getchildbyid (childID)
Copy Codechildid Node ID int type
Returning a Node instance

Getchildbyname get node instances based on node name
    1. Type method
    2. CWD firefly/distributed/manager.py
    3. Params Getchildbyname (ChildName)
Copy Codechildname node name str type
Returning a Node instance
Addchild Adding a child node
    1. Type method
    2. CWD firefly/distributed/manager.py
    3. Params AddChild (Child)
Copy CodeChild Node Instance instance type
Add a node to the manager, in the format {Node ID: node Instance}, if the node already exists, returns a text description
Dropchild Deleting a node
    1. Type method
    2. CWD firefly/distributed/manager.py
    3. Params Dropchild (Child)
Copy CodeChild Node Instance instance type
To remove a node from the manager

Dropchildbyid

Delete a node by Node ID
    1. Type method
    2. CWD firefly/distributed/manager.py
    3. Params Dropchildbyid (childID)
Copy Codechildid Node ID int type
Delete the node in the Node Manager by Node ID
Callchild interface for calling child nodes
    1. Type method
    2. CWD firefly/distributed/manager.py
    3. Params Callchild (CHILDID,*ARGS,**KW)
Copy Codechildid child Node ID
Gets the child node instance through the child node ID, invokes the child node interface, and returns the deferred object.

Callchildbyname to invoke the interface of a child node by its node name
    1. Type method
    2. CWD firefly/distributed/manager.py
    3. Params Callchildbyname (CHILDNAME,*ARGS,**KW)
Copy Codechildname child node name
Gets the child node instance through the child node name, invokes the child node interface, and returns the deferred object.

Class RemoteObject The remote Call object, which is implemented in the child node service process. This object can be used to invoke the interface method in the root node's process.
SetName setting the name of the node
    1. Type method
    2. CWD firefly/distributed/node.py
Copy CodeParams setName (name)Name node names str typeset the node name to name GetName Gets the name of the node
    1. Type method
    2. CWD firefly/distributed/node.py
    3. Params GetName ()
Copy Codestring that returns the name of the node
Connect initializes the remote Call object and connects to the root node.
    1. Type method
    2. CWD firefly/distributed/node.py
    3. Params Connect (addr)
Copy CodeADDR Address of the remote connection tuple type (hostname, port number) For example: (' localhost ', 8888)
Addservicechannel sets the service object, which manages the interface methods that can be called by the root node in this service object.
    1. Type method
    2. CWD firefly/distributed/node.py
    3. Params Addservicechannel (Service)
Copy CodeService is//CWD firefly/utils/services.py service class
Takeproxy send proxy channel objects like remote server
    1. Type method
    2. CWD firefly/distributed/node.py
    3. Params Takeproxy ()
Copy CodeCallremote calls the interface method in the root node remotely.
    1. Type method
    2. CWD firefly/distributed/node.py
    3. Params Callremote (COMMANDID,*ARGS,**KW)
Copy CodecommandId instruction Number int type
A method to invoke the instruction number CommandID in the root node remotely


Class Proxyreference Proxy Channel
AddService-----------Add a service channel
    1. Type method
    2. CWD firefly/distributed/reference.py
    3. Params AddService (Service)
Copy CodeService Channel Instance instance type

Remote_callchild sending data--------------agent
    1. Type method
    2. CWD firefly/distributed/reference.py
    3. Params Remote_callchild (COMMAND,*ARG,**KW)
Copy Codeclass PBROOTPB protocol, root node object.
Addservicechannel sets the service object, which manages the interface methods that can be called by node child nodes.
    1. Type method
    2. CWD firefly/distributed/root.py
    3. Params Addservicechannel (Service)
Copy CodeService Object Instance instance type
Remote_takeproxy Setting the proxy channel
    1. Type method
    2. CWD firefly/distributed/root.py
    3. Params Remote_takeproxy (Name,transport)
Copy CodeName child Node ID, also child node name
Example of transport proxy channel instance type
Instantiate the child node, add the child node to the Node Manager, set the node agent channel to transport
Remote_calltarget Remote Call Method
    1. Type method
    2. CWD firefly/distributed/root.py
    3. Params Remote_calltarget (COMMAND,*ARGS,**KW)
Copy Codecommand command number int type
Method of command number command in remote call to root node
Dropchild deleting child node records
    1. Type method
    2. CWD firefly/distributed/root.py
    3. Params Dropchild (*ARGS,**KW)
Copy CodeTo remove a child node from the node Manager
Dropchildbyid deleting child node records by ID
    1. Type method
    2. CWD firefly/distributed/root.py
    3. Params Dropchildbyid (childID)
Copy Codechildid child Node ID

Callchild interface for calling child nodes
    1. Type method
    2. CWD firefly/distributed/root.py
    3. Params Callchild (KEY,*ARGS,**KW)
Copy CodeKey child Node ID
Gets the child node instance through the child node ID, invokes the child node interface, and returns the deferred object.

Callchildbyname interface for calling child nodes
    1. Type method
    2. CWD firefly/distributed/root.py
    3. Params Callchildbyname (CHILDNAME,*ARGS,**KW)
Copy Codechildname child node name
Gets the child node instance through the child node name, invokes the child node interface, and returns the deferred object.

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.