[Zodb-checkins] CVS: Packages/ZEO - StorageServer.py:1.38.2.1 ServerStub.py:1.5.2.1 ClientStorage.py:1.41.2.1

Toby Dickenson tdickenson@geminidataloggers.com
Fri, 28 Jun 2002 05:32:22 -0400


Update of /cvs-repository/Packages/ZEO
In directory cvs.zope.org:/tmp/cvs-serv14506

Modified Files:
      Tag: toby-signal-branch
	StorageServer.py ServerStub.py ClientStorage.py 
Log Message:
added 'signal', a new ZEO-marshalled method for accessing a storages additional features that are not covered by the standard storage API. This change is experimental

=== Packages/ZEO/StorageServer.py 1.38 => 1.38.2.1 ===
         return ()
 
+    def signal(self,signalname,params):
+        fn = getattr(self.__storage,'signal',None)
+        if callable(fn):
+            return fn(signalname,params)
+        else:
+            raise NotImplementedError('signal(%r)'%(signalname,))
+
     def tpc_begin(self, id, user, description, ext, tid, status):
         if self._transaction is not None:
             if self._transaction.id == id:


=== Packages/ZEO/ServerStub.py 1.5 => 1.5.2.1 ===
             return self.rpc.call('history', oid, version, length)
 
+    def signal(self, signalname, params):
+        return self.rpc.call('signal', str(signalname), params)
+
     def load(self, oid, version):
         return self.rpc.call('load', oid, version)
 


=== Packages/ZEO/ClientStorage.py 1.41 => 1.41.2.1 ===
         return self._server.history(oid, version, length)
 
+    def signal(self, signalname, params):
+        """Call the signal method of the underlying storage.
+        This is useful if your storage supports features outside
+        the standard storage API, and you want to access them
+        over ZEO. Your storage should raise NotImplementedError
+        if it does not recognise signalname. The StorageServer
+        will do the same if a storage does not provide a signal
+        method.
+        """
+        return self._server.signal(signalname, params)
+
     def loadSerial(self, oid, serial):
         return self._server.loadSerial(oid, serial)