Attempt to introduce flood control. BROKEN.
This commit is contained in:
parent
a8642a6440
commit
6644634d98
@ -82,8 +82,15 @@ class eventManager():
|
|||||||
return self._eventQueue
|
return self._eventQueue
|
||||||
def getRunning(self):
|
def getRunning(self):
|
||||||
return self.running
|
return self.running
|
||||||
|
def getEventQueueSize(self):
|
||||||
|
return self._eventQueue.qsize()
|
||||||
def putToEventQueue(self,event, data):
|
def putToEventQueue(self,event, data):
|
||||||
if not isinstance(event, fenrirEventType):
|
if not isinstance(event, fenrirEventType):
|
||||||
return False
|
return False
|
||||||
|
if event == fenrirEventType.Ignore:
|
||||||
|
return False
|
||||||
|
if self.getEventQueueSize() > 40:
|
||||||
|
if not event in [fenrirEventType.ScreenUpdate, fenrirEventType.HeartBeat]:
|
||||||
|
self.cleanEventQueue()
|
||||||
self._eventQueue.put({"Type":event,"Data":data})
|
self._eventQueue.put({"Type":event,"Data":data})
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user