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
- Type method
- CWD firefly/distributed/child.py
- Params GetName ()
- Returns the name of the node
Copy CodeSettransport Setting the channel of a child node
- Type method
- CWD firefly/distributed/child.py
- Params Settransport (transport)
Copy Codeexample of transport proxy channel instance type Callbackchild the interface of the back tone node
- Type method
- CWD firefly/distributed/child.py
- 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"
- Type method
- CWD firefly/distributed/manager.py
- Params Getchildbyid (childID)
Copy Codechildid Node ID int type Returning a Node instance
Getchildbyname get node instances based on node name
- Type method
- CWD firefly/distributed/manager.py
- Params Getchildbyname (ChildName)
Copy Codechildname node name str type Returning a Node instance Addchild Adding a child node
- Type method
- CWD firefly/distributed/manager.py
- 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
- Type method
- CWD firefly/distributed/manager.py
- Params Dropchild (Child)
Copy CodeChild Node Instance instance type To remove a node from the manager
Dropchildbyid
Delete a node by Node ID
- Type method
- CWD firefly/distributed/manager.py
- 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
- Type method
- CWD firefly/distributed/manager.py
- 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
- Type method
- CWD firefly/distributed/manager.py
- 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
- Type method
- 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
- Type method
- CWD firefly/distributed/node.py
- Params GetName ()
Copy Codestring that returns the name of the node Connect initializes the remote Call object and connects to the root node.
- Type method
- CWD firefly/distributed/node.py
- 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.
- Type method
- CWD firefly/distributed/node.py
- Params Addservicechannel (Service)
Copy CodeService is//CWD firefly/utils/services.py service class Takeproxy send proxy channel objects like remote server
- Type method
- CWD firefly/distributed/node.py
- Params Takeproxy ()
Copy CodeCallremote calls the interface method in the root node remotely.
- Type method
- CWD firefly/distributed/node.py
- 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
- Type method
- CWD firefly/distributed/reference.py
- Params AddService (Service)
Copy CodeService Channel Instance instance type
Remote_callchild sending data--------------agent
- Type method
- CWD firefly/distributed/reference.py
- 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.
- Type method
- CWD firefly/distributed/root.py
- Params Addservicechannel (Service)
Copy CodeService Object Instance instance type Remote_takeproxy Setting the proxy channel
- Type method
- CWD firefly/distributed/root.py
- 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
- Type method
- CWD firefly/distributed/root.py
- 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
- Type method
- CWD firefly/distributed/root.py
- Params Dropchild (*ARGS,**KW)
Copy CodeTo remove a child node from the node Manager Dropchildbyid deleting child node records by ID
- Type method
- CWD firefly/distributed/root.py
- Params Dropchildbyid (childID)
Copy Codechildid child Node ID
Callchild interface for calling child nodes
- Type method
- CWD firefly/distributed/root.py
- 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
- Type method
- CWD firefly/distributed/root.py
- 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.
|