游戏开发论坛

 找回密码
 立即注册
搜索
查看: 3773|回复: 0

【Firefly API文档】—— Package Distributed

[复制链接]

119

主题

119

帖子

694

积分

版主

Rank: 7Rank: 7Rank: 7

积分
694
发表于 2013-8-14 14:47:57 | 显示全部楼层 |阅读模式
package distributed
这个包中主要封装了各个服务进程间进行通信的方法。node子节点域root根节点进程中的接口调用返回的都是延迟对象。关于延迟对象的使用,详剑twisted中Deferred对象。
calss Child
child对象对应的是连接到本服务进程的某个服务进程对象。称为子节点对象。
getName
获取子节点的名称
type method
//cwd firefly/ distributed / child.py
Params getName()
setTransport
设置子节点的通道
type method
//cwd firefly/ distributed / child.py
Params setTransport(transport)
callbackChild
回调子节点的接口
type method
//cwd firefly/ distributed / child.py
Params allbackChild(*args,**kw)
class manager
一个子节点管理基类
getChildById
根据节点id获取节点实例”
type method
//cwd firefly/ distributed / manager.py
Params getChildById(childId)
getChildByName
根据节点的名称获取节点实例
type method
//cwd firefly/ distributed / manager.py
Params getChildByName(self,childname)
addChild
添加一个子节点
type method
//cwd firefly/ distributed / manager.py
Params addChild(self,child)
dropChild
删除一个节点
type method
//cwd firefly/ distributed / manager.py
Params dropChild(self,*arg,**kw)
callChild
调用子节点的接口
type method
//cwd firefly/ distributed / manager.py
ParamscallChild(*args,**kw)
callChildByName
调用子节点的接口
type method
//cwd firefly/ distributed / manager.py
Params callChildByName(self,*args,**kw)
dropChildByID
删除一个child节点
type method
//cwd firefly/ distributed / manager.py
Params dropChildByID(self,childId)
class ChildsManager
子节点管理器
getChildById
根据节点的ID获取节点实例
type method
//cwd firefly/ distributed / manager.py
Params getChildById(self,childId)
getChildByName
根据节点的名称获取节点实例
type method
//cwd firefly/ distributed / manager.py
Param getChildByName(self,childname)
addChild
添加一个child节点
type method
//cwd firefly/ distributed / manager.py
Params addChild(self,child)
dropChild
删除一个child 节点
type method
//cwd firefly/ distributed / manager.py
Params dropChildByID(self,childId)
callChild
调用子节点的接口
type method
//cwd firefly/ distributed / manager.py
Params callChild(self,childId,*args,**kw)
callChildByName
调用子节点的接口,childname: str 子节点的名称
type method
//cwd firefly/ distributed / manager.py
Params callChildByName(self,childname,*args,**kw)
class RemoteObject
远程调用对象,子节点服务进程中实现。可以通过这对象去调用root节点的进程中的接口方法。
setName
设置节点的名称
type method
//cwd firefly/ distributed / node.py
Params setName(self,name)
getName
获取节点的名称
type method
//cwd firefly/ distributed / node.py
Params getName(self)
connect
初始化远程调用对象,连接root节点。
type method
//cwd firefly/ distributed / node.py
Params connect(self,addr)
addServiceChannel
设置服务对象,这个服务对象中管理了可供root节点调用的接口方法。
type method
//cwd firefly/ distributed / node.py
Params addServiceChannel(self,service)
takeProxy
像远程服务端发送代理通道对象
type method
//cwd firefly/ distributed / node.py
Params takeProxy(self)
callRemote
远程调用root节点中的接口方法。
type method
//cwd firefly/ distributed / node.py
Params callRemote(self,commandId,*args,**kw)
class ProxyReference
代理通道
addService
添加一条服务通道
type method
//cwd firefly/ distributed / reference.py
Params addService(self,service)
remote_callChild
代理发送数据
type method
//cwd firefly/ distributed / reference.py
Params remote_callChild(self, command,*arg,**kw)
class BilateralBroker
connectionLost
type method
//cwd firefly/ distributed / root.py
Params connectionLost(self, reason)
class PBRoot
PB 协议,root节点对象。
addServiceChannel
设置服务对象,这个服务对象中管理了可供node子节点调用的接口方法。
type method
//cwd firefly/ distributed / root.py
Params addServiceChannel(self,service)
remote_takeProxy
设置代理通道
@param addr: (hostname,port)hostname 根节点的主机名,根节点的端口
type method
//cwd firefly/ distributed / root.py
Params remote_takeProxy(self,name,transport)
remote_callTarget
远程调用方法
type method
//cwd firefly/ distributed / root.py
remote_callTarget(self,command,*args,**kw)
dropChild
删除子节点记录
type method
//cwd firefly/ distributed / root.py
dropChild(self,*args,**kw)
dropChildByID
根据ID删除子节点记录
type method
//cwd firefly/ distributed / root.py
dropChildByID(self,childId)
callChild
调用子节点的接口,返回的是延迟对象。
type method
//cwd firefly/ distributed / root.py
callChild(self,key,*args,**kw)
callChildByName
调用子节点的接口
type method
//cwd firefly/ distributed / root.py
callChildByName(self,childname,*args,**kw)

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2024-4-26 18:29

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表