Author: dmeyer
Date: Sat Apr 22 18:46:25 2006
New Revision: 1469

Modified:
   trunk/beacon/src/monitor.py

Log:
that was too easy....

Modified: trunk/beacon/src/monitor.py
==============================================================================
--- trunk/beacon/src/monitor.py (original)
+++ trunk/beacon/src/monitor.py Sat Apr 22 18:46:25 2006
@@ -94,6 +94,7 @@
         self._db = db
         self._query = query
         self._checker = None
+        self._check_changes = []
         self.items = self._db.query(**self._query)
         if not _master:
             _master = Master(db)
@@ -116,8 +117,13 @@
             # scan? For one part, the changes here here the item changes 
itself,
             # so we would update the client all the time. So it is better to 
wait
             # here. Note: with inotify support this should not happen often.
+            self._check_changes.extend(changes)
             return True
 
+        if self._check_changes:
+            changes = self._check_changes + changes
+            self._check_changes = []
+            
         current = self._db.query(**self._query)
 
         # The query result length is different, this is a change
@@ -200,7 +206,12 @@
         # The client will update its query on this signal, so it should
         # be safe to do the same here. *cross*fingers*
         self.items = self._db.query(**self._query)
-        self.callback('changed')
+        # Do not send 'changed' signal here. The db was changed and the
+        # master notification will do the rest. Just to make sure it will
+        # happen, start a Timer
+        if self._check_changes:
+            # Set new check timer. This should not be needed, but just in case 
:)
+            WeakOneShotTimer(self.check, []).start(0.5)
         if first_call:
             self.callback('checked')
 


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to