Fixed a deadlock generated by last fix, attributes in Python interpreter are now updated inside the main Python loop

This commit is contained in:
Emmanuel Durand
2020-06-08 15:42:22 +00:00
parent 282988429d
commit 45a0d7646b
4 changed files with 84 additions and 70 deletions

View File

@@ -76,15 +76,16 @@ class SplashServer(BaseHTTPRequestHandler):
else:
self.sendResult("")
def splash_init():
def splash_init() -> None:
global splashServer
print("Starting HTTP server")
splashServer = HTTPServer((hostName, hostPort), SplashServer)
splashServer.timeout = 0.1
def splash_loop():
def splash_loop() -> bool:
global splashServer
splashServer.handle_request()
return True
def splash_stop():
def splash_stop() -> None:
print("Shutting down HTTP server")