optimized event handler

This commit is contained in:
Adam Saudagar 2020-10-18 06:13:59 +05:30
parent b44039780c
commit db5299004b

View File

@ -1,4 +1,6 @@
import logging import logging
import time
from fishy.engine import SemiFisherEngine from fishy.engine import SemiFisherEngine
from fishy.engine.fullautofisher.engine import FullAuto from fishy.engine.fullautofisher.engine import FullAuto
@ -16,6 +18,7 @@ class EngineEventHandler:
while len(self.event) > 0: while len(self.event) > 0:
event = self.event.pop(0) event = self.event.pop(0)
event() event()
time.sleep(0.1)
def toggle_semifisher(self): def toggle_semifisher(self):
self.event.append(self.semi_fisher_engine.toggle_start) self.event.append(self.semi_fisher_engine.toggle_start)