This commit is contained in:
Colombo 2020-02-29 13:31:36 +04:00
parent e9c0f5fb9f
commit 7180076ecf

View file

@ -29,6 +29,8 @@ class Subprocessor(object):
def kill(self): def kill(self):
self.p.terminate() self.p.terminate()
self.p.join() self.p.join()
self.s2c.close()
self.c2s.close()
#overridable optional #overridable optional
def on_initialize(self, client_dict): def on_initialize(self, client_dict):
@ -77,7 +79,12 @@ class Subprocessor(object):
time.sleep(0.001) time.sleep(0.001)
self.on_finalize() self.on_finalize()
c2s.put ( {'op': 'finalized'} ) c2s.put ( {'op': 'finalized'} )
self.s2c.close()
self.c2s.close()
return return
except Subprocessor.SilenceException as e: except Subprocessor.SilenceException as e:
pass pass
@ -281,6 +288,7 @@ class Subprocessor(object):
while True: while True:
for cli in self.clis[:]: for cli in self.clis[:]:
if cli.state != 2:
terminate_it = False terminate_it = False
while not cli.c2s.empty(): while not cli.c2s.empty():
obj = cli.c2s.get() obj = cli.c2s.get()