Ejemplo n.º 1
0
 def __call__(self, *args, **kw):
     """(internal) action method.
     """
     cacheID = self.broker.cachedRemotelyAs(self.cached)
     if cacheID is None:
         from pb import ProtocolError
         raise ProtocolError("You can't call a cached method when the object hasn't been given to the peer yet.")
     return self.broker._sendMessage('cache', self.perspective, cacheID, self.name, args, kw)
Ejemplo n.º 2
0
 def callRemote(self, _name, *args, **kw):
     """(internal) action method.
     """
     cacheID = self.broker.cachedRemotelyAs(self.cached)
     if isinstance(_name, unicode):
         _name = _name.encode("utf-8")
     if cacheID is None:
         from pb import ProtocolError
         raise ProtocolError("You can't call a cached method when the "
                             "object hasn't been given to the peer yet.")
     return self.broker._sendMessage(b'cache', self.perspective, cacheID,
                                     _name, args, kw)