Exemple #1
0
    def async_findObjectById4All(self,
                                 callback,
                                 id,
                                 context=ServantProxy.mapcls_context()):
        oos = tarscore.TarsOutputStream()
        oos.write(tarscore.string, 1, id)

        self.tars_invoke_async(ServantProxy.TARSNORMAL, "findObjectById4All",
                               oos.getBuffer(), context, None, callback)
Exemple #2
0
    def findObjectById(self, id, context = ServantProxy.mapcls_context()):
        oos = tarscore.TarsOutputStream();
        oos.write(tarscore.string, 1, id);

        rsp = self.tars_invoke(ServantProxy.TARSNORMAL, "findObjectById", oos.getBuffer(), context, None);

        ios = tarscore.TarsInputStream(rsp.sBuffer);
        ret = ios.read(tarscore.vctclass(EndpointF), 0, True);

        return (ret);
Exemple #3
0
    def findObjectByIdInSameSet(self, id, setId, context = ServantProxy.mapcls_context()):
        oos = tarscore.TarsOutputStream();
        oos.write(tarscore.string, 1, id);
        oos.write(tarscore.string, 2, setId);

        rsp = self.tars_invoke(ServantProxy.TARSNORMAL, "findObjectByIdInSameSet", oos.getBuffer(), context, None);

        ios = tarscore.TarsInputStream(rsp.sBuffer);
        ret = ios.read(tarscore.int32, 0, True);
        activeEp = ios.read(tarscore.vctclass(EndpointF), 3, True);
        inactiveEp = ios.read(tarscore.vctclass(EndpointF), 4, True);

        return (ret, activeEp, inactiveEp);
Exemple #4
0
    def findObjectById4All(self, id, context=ServantProxy.mapcls_context()):
        oos = tarscore.TarsOutputStream()
        oos.write(tarscore.string, 1, id)

        rsp = self.tars_invoke(ServantProxy.TARSNORMAL, "findObjectById4All",
                               oos.getBuffer(), context, None)

        ios = tarscore.TarsInputStream(rsp.sBuffer)
        ret = ios.read(tarscore.int32, 0, True)
        activeEp = ios.read(tarscore.vctclass(EndpointF), 2, True)
        inactiveEp = ios.read(tarscore.vctclass(EndpointF), 3, True)

        return (ret, activeEp, inactiveEp)
Exemple #5
0
    def findObjectByIdInSameGroup(self,
                                  id,
                                  context=ServantProxy.mapcls_context()):
        oos = tarscore.TarsOutputStream()
        oos.write(tarscore.string, 1, id)
        rsp = self.tars_invoke(ServantProxy.TARSNORMAL,
                               "findObjectByIdInSameGroup", oos.getBuffer(),
                               context, None)

        startDecodeTime = time.time()
        ios = tarscore.TarsInputStream(rsp.sBuffer)
        ret = ios.read(tarscore.int32, 0, True)
        activeEp = ios.read(tarscore.vctclass(EndpointF), 2, True)
        inactiveEp = ios.read(tarscore.vctclass(EndpointF), 3, True)
        endDecodeTime = time.time()
        return (ret, activeEp, inactiveEp, (endDecodeTime - startDecodeTime))
Exemple #6
0
    def async_findObjectByIdInSameSet(self, callback, id, setId, context = ServantProxy.mapcls_context()):
        oos = tarscore.TarsOutputStream();
        oos.write(tarscore.string, 1, id);
        oos.write(tarscore.string, 2, setId);

        rsp = self.tars_invoke_async(ServantProxy.TARSNORMAL, "findObjectByIdInSameSet", oos.getBuffer(), context, None, callback);