Cleanup controller

This commit is contained in:
Andrew Kay
2019-06-29 17:05:19 -05:00
parent baf22c7008
commit f9ea0353fe

View File

@@ -17,7 +17,7 @@ class Controller:
def __init__(self, interface, create_session):
self.logger = logging.getLogger(__name__)
self.running = True
self.running = False
self.interface = interface
self.create_session = create_session
@@ -25,6 +25,12 @@ class Controller:
self.terminal = None
self.session = None
# Target time between POLL commands in seconds when a terminal is connected or
# no terminal is connected.
#
# The connected poll period only applies in cases where the terminal responded
# with TR/TA to the last poll - this is an effort to improve the keystroke
# responsiveness.
self.connected_poll_period = 1 / 10
self.disconnected_poll_period = 5
@@ -33,6 +39,8 @@ class Controller:
last_poll_time = None
last_poll_response = None
self.running = True
while self.running:
if self.session:
try: