|
From: <ni...@us...> - 2010-11-10 10:39:05
|
Revision: 97
http://openautomation.svn.sourceforge.net/openautomation/?rev=97&view=rev
Author: nilss1
Date: 2010-11-10 10:38:59 +0000 (Wed, 10 Nov 2010)
Log Message:
-----------
only use priority Queue if more then 10 Messages in Queue
Modified Paths:
--------------
PyWireGate/trunk/knx_connector/KNX_Connector.py
Modified: PyWireGate/trunk/knx_connector/KNX_Connector.py
===================================================================
--- PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-10 09:40:34 UTC (rev 96)
+++ PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-10 10:38:59 UTC (rev 97)
@@ -213,7 +213,10 @@
def _put(self, item):
## add addr to active addr
addr = item[0]
- prio = int(self.activeaddr.count(addr) > 5)
+ prio = 0
+ if len(self.queue) > 10:
+ ## if queue size is over 10 use priority
+ prio = int(self.activeaddr.count(addr) > 5)
self.activeaddr.append(addr)
heapq.heappush(self.queue,(prio,item))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|