zoukankan      html  css  js  c++  java
  • 【Firefly API文档】—— Package Distributed

    http://bbs.gameres.com/forum.php?mod=viewthread&tid=219654

    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)

  • 相关阅读:
    玩家上线
    小退
    GS发包到MS
    share初始化
    3 水仙花数
    The left-hand side of an assignment must be a variable,代码中使用了中文的字符
    Mac Sublime Text 浏览器 设置快捷键 让html文件在浏览器打开
    2 质数求解
    1 斐波那契的兔子
    18 赛手的名单
  • 原文地址:https://www.cnblogs.com/123ing/p/3990546.html
Copyright © 2011-2022 走看看